Home | Appendix

|  |  | Smart Rules

Smart rules are smart groups‚ evolved. Built in the same style as smart groups, smart rules don't just show items matching criteria, they can act on them! From something as simple as adding (or changing) a color label, to modifying a filename then filing a document in another location, smart rules provide some powerful automation possibilities. And they're not just for the technically inclined. No programming experience is needed for almost every action available. Smart rules are conceptually simple and can be summed up as follows: When this event occurs > do this action > on items matched > in this location. Smart rules are made of four parts: A location: This is where the smart rule will look for matching items. Matching criteria: Like a smart group, you can specify criteria to be matched. The smart rule will only act on the matched items. An action: This is the action the smart rule performs when the event occurs. An event: This is an event that causes an action to occur, e.g., an "On Quit" event. If used in a smart rule, a specified action would run when you quit DEVONthink. Create a Smart Rule Smart rules can be created in one of two ways: Click the + button at the bottom of the sidebar and choose New Smart Rule. The Search in dropdown will target the current location. Control-click an item in the sidebar and choose New Smart Rule from the contextual menu. This will specifically target that item in the Search in dropdown. Note in either case you can change the Search in parameter to target other locations, including all open databases.
Note: Smart rules are considered global objects and can be created only in the Navigate sidebar of a main window. If you want to create a smart rule for a group in the item list, choose Data > Reveal to display it in the sidebar.
When you create a new smart rule, you will be shown the predicate editor, just as you see with smart groups. Just follow these simple steps to define the parameters of the rule (with an example): Name: Give the rule a name, like Label Edited Screencaptures. Location: Set the Search in dropdown to target your desired location, like a group you add screen captures to. The more specific the better; a good idea is to use e.g., a database's inbox. Matching: Add any criteria to be matched, e.g., Name begins with screen and Kind is Image. Event: Choose an event to trigger the smart rule, like specifying On Save to run the smart rule when matched items are saved in DEVONthink Action: Choose an action for the smart rule, perhaps Change Name to add "_edited" to the name. This rule shown above would add "_edited" as a suffix to the name of any edited images whose name begins with "screen". One step further‚ chained actions: If you hadn't noticed, there's a + button to the right of the action you specified. And yes, that means you can chain multiple actions in a smart rule! For example, we could add an action to open the edited imaged in the system default application after it has been renamed.
Note: Bear in mind, smart rule actions run in series, i.e., the actions run from top to bottom, first to last. This means the order of the actions affects the outcome. Think carefully about this if you decide to create chained actions.
We hope this has given you a good overview of creating a smart rule. Please see the appendix for a complete list of available Events and Actions. For those interested in the Execute Script action, continue to the next section… Importing and Exporting Smart rules can be exported to the Finder, sent by email, and e.g., reimported to DEVONthink on another Mac. Drag a smart rule to the desktop to save it to a file or Control-click it and choose Export. Double-click a saved smart rule to import it, drag it into the sidebar, or Control-click into the sidebar and choose Import.