Home | Appendix

Quick links: |  | Adding an External Script Adding an Embedded Script Terminology

|  |  | Reminder Scripts

Reminders have several pre-built alarms available for notifications. However, you can only specify one alarm per reminder. Reminder scripts are AppleScripts run by an alarm set on a specific reminder for an item. By using or writing your own, you can extend notification possibilities of your reminders. Adding an External Script To add an external script as an alarm for a reminder, choose Execute External Script. The next dropdown lists any available AppleScripts in the `~/Library/Application Scripts/com.devon-technologies.think3/Reminders` directory. Add any of your own scripts to this directory to make them available for any alarm you set. Currently, there is only one example script pre-installed: Open Document: Opens the document in a new window when the alarm triggers. Adding an Embedded Script Sometimes you only need to add a script for a specific purpose, not general use with all reminders. DEVONthink allows you to quickly write an ad-hoc AppleScript specifically for the current reminder. To write an embedded script for a reminder, choose Execute Embedded Script as the alarm. Click the … button and a popup will appear with a pre-built handler in place. Add your code as necessary, then press the compile button, the one with the stylized eye, to make sure it compiles correctly. If it does, you will see the code format itself subtly. If not, you will hear a system alert. Click outside the popup to dismiss it. When the alarm goes off, the script will be executed.
Note: When a reminder is set to Once, the reminder is removed and the embedded script lost after the alarm goes off. If you have code you'd like to potentially use again, put it in an external script.
Terminology Triggered scripts are defined by a specific handler: `on performReminder(var)`, where var is the variable representing the item the alarm is set for.
Example: on performReminder(theRecord) tell application id "DNtp" set label of theRecord to 1 say (name of theRecord as string) end tell end performReminder