Smart Rule Events and Actions

DEVONthink provides many powerful actions for use with smart rules and batch processing. Smart rules run when certain events happen, e.g., when you open a file or DEVONthink syncs. These are called event triggers and are listed first. Following that are the available actions for both functions.

Events

When an action is triggered is almost as important as the action itself. Actions can be triggered when any of these events occur:

You can add and remove multiple event triggers by pressing the + or - buttons. For example, you could use an On Import and an On Moving event trigger to act on imported items or items being moved in your databases.

Actions

The power in smart rules and batch processing is found in the actions. DEVONthink provides actions that cover simple tasks, e.g., prefixing a filename, all the way to ultra-powerful AppleScript injection via external or embedded scripts. Since you can chain multiple actions together, the possibilities are nearly endless.

Note batch processing supports a smaller number of actions than smart rules. Here's a list of available actions with those also usable in batch processing marked with "(BP)":

Item scanning: Supported both in smart rules and batch processing, the next actions allow you to scan the name or text of a document and use the results when found. Each of the actions also has a parameter you specify for the type of data you're scanning for. These actions and parameters can be used with subsequent actions that support placeholders, e.g., Scan Text: DateDocument Date with Change Modification Date. If the action returns no results, actions using the results will not be executed. However, unrelated actions in the smart rule chain will be executed normally.

The following four parameters are used with the Scan Name and Scan Text actions. With String, Date, and Amount, a prefix and/or suffix before/after the wildcard has to be specified.

Scripting and Chat: These commands are used for adding script actions processes or integrating an AI model, e.g., ChatGPT, into your automations. You can read more about these actions in the Smart Rule Scripts section.

Batch Processing Only: There is one action found only in batch processing: User Input. As batch processing is a more impromptu mechanism, it's a good place to allow user interaction. This smart action opens a dialog for you to enter information, e.g., to type a prompt, enter a name, etc. The result is stored in the User Input placeholder, used by a variety of actions.

The following smart actions are only available in the higher editions of DEVONthink. You will find them throughout the list of actions in the dropdown menu as you're creating your smart rule.

Custom Metadata: If you have specified custom metadata fields, you will have options to change values with an action. For example, if you had a Boolean field named "Done", you could have the action set this field to true when the action is triggered. (BP)