DEVONthink's Automation Options
The beauty of your paperless office in DEVONthink is that you can automate workflows. For example, to sort new documents to the right place in your databases, you don’t have to dedicate your time and attention to each document. But what may not be obvious is which one of DEVONthink’s capabilities to choose. Here are the main options and when it’s best to use each.
Choosing an automation option can be broken down into a simple matrix depending on the selection of items and the frequency of the actions:
Items | Activity | |
---|---|---|
Smart Rule | unselected | frequent |
Batch Process | selected | infrequent |
Scripting | (un)selected | (in)frequent |
Smart Rules
Smart rules are a specialized type of smart group that acts on items matched by criteria you define. For example, Kind is News, Date Added is Today, and Name contains “music”. You can then add built-in actions, e.g., Change Label, Add Tags, etc. to automatically change the matched items.
These are intended for habitual actions, things you’d do often. This is dictated by the event trigger in the rule. In the above example, a trigger could be On News, so the rule would process matching RSS articles after a feed updated.
Smart rules are intended to be run as a background process. As you work in DEVONthink, it’s just processing things behind the scenes. A general rule is: If you want to act on selected items, a smart rule is not the best option.
Here you find a separate blog article about smart rules.
Batch Process
Batch processing is used for one-off actions, to handle more impromptu events on selected items. If you find yourself in a situation where you just need to make a change to items but it’s not an action you’d need to do regularly, a batch process is a great option. Batch processing is available under Tools > Batch Process or by pressing ⌃⌘B.
Say you imported some images after a visit of an interesting place and you see their names begin with “DSC100-”. You can use a Scan Name > String command to capture part of the name, then use a Change Name command to prefix each selected document’s name with the name of the archive or your project. Such ad-hoc renaming is best done with batch processing.
Here you find a separate blog article about batch processing.
Scripting
Similar to using batch processing, scripts allow you to act on selected items. So if you want to do the same actions regularly on selected items, a script is usually the best option. But you can also do a wide variety of other actions unavailable to the other automation options. These may be creating new items, changing window sizes, having DEVONthink send information to another application, etc.
Looking at the Script menu, you will find folders split up into different contexts. One example is the Data folder. This contains several scripts for accomplishing things like removing duplicates from selected documents or checking the health of all your open databases. These kinds of actions aren’t simply done with some built-in actions like those found in smart rules and batch processing. They require scripting — in AppleScript or JavaScript for Automation (JXA), essentially writing the actions yourself.
If you are inclined to explore scripting, the Automation chapter of the built-in help and handbook, as well as the DEVONthink > Automation section of our user community are good places to learn more about this.
Please note, there is a specialized action for smart rules and batch processing: Execute Script. This action give you the power to extend these two options beyond the built-in actions, which is also covered in the chapter Automation.
By the way, in our blog we have a tag automation, so you can browse our blog for articles on this topic.