Home | Appendix

|  |  | Internal Scripts

The Scripts menu of DEVONthink, located to the left of the Help menu, gives you access to a large number of pre-made scripts, with more scripts available. These scripts are not only useful for every day use, but are also great for learning how to script DEVONthink. All the scripts we provide are editable using the Apple's Script Editor, though we do suggest making copies to work on. They are located in `~/Library/Application Scripts/com.devon-technologies.think/Menu`. Open this folder in the Finder with Scripts > Open Scripts Folder command. Add your own scripts to the menu by adding them to the appropriate subfolder in this directory, even creating subfolders of your own. A complete listing of the installed scripts is in the Appendix. Script Localization If you need to support multiple languages in your scripts, it is possible to vary the content of messages based on the language in which DEVONthink is running. You must have saved your script as a script bundle, a `.scptd` file. In the `Contents > Resources` directory of the bundle, add a folder with the two character country code for the language, followed by `.lproj`, e.g., `fr.lproj` would contain French strings. Add your own definitions in a `Localizable.strings` and put it in this directory. Define a word or phrase in your language, followed by the translated phrase. For example, in a strings file in a `de` subdirectory, enter: `"This is a new day!"="Heute ist ein neuer Tag!";`. In your script, you'd enter a command like, `display alert (localized string "This is a new day!")`. If DEVONthink is running in German, you'd see the German message. Localization is also available for smart templates. See the Template Localization section later in this chapter.