Devonian Times Masthead

The DEVONtechnologies Blog

Using Custom Metadata for Automation

November 3, 2024 — Jim Neumann
Screenshot showing the editor for a smart rule in DEVONthink. In the smart rule, a placeholder for custom metadata is used for a file action, as described in the tip.

Thinking about making your automations in DEVONthink more dynamic using variable values? Combine smart rules or batch processing with metadata you’ve defined yourself*. We show you an example how this could work. Perhaps we can inspire you to do a little tinkering yourself.

In our example, we will use custom metadata together with a smart rule to automatically file documents to a defined location in DEVONthink. Go into DEVONthink’s Settings > Data and define a custom attribute with a data type of Single-Line Text. Here, we’ve used Filing Group. Select a document and open the Tools > Inspector > Info: Custom info inspector. Enter a group location where you want to file the document, leaving out the leading forward slash, e.g., Tech/AI. Select and fill in the attribute on other documents as desired. One of the benefits of Single-Line Text is autocompletion. So if you edit the attribute on another document, it should show matches as you type.

Now create a smart rule and add a File action. Clear the default location, secondary-click the text field, and choose Insert Placeholder > Custom Metadata and the attribute you are using. Run the smart rule and the items will be filed in the location specified by the custom metadata. In our example, the email would be move to the Personal database, then filed into an Emails/Tech/AI group in its Inbox, as shown in the screenshot. So the idea behind this workflow is that we use the path to a desired location in our database as the value of custom metadata and insert this metadata through a placeholder in the smart rule.

Okay, this may seem like a lot of typing and tweaking. But is it absolutely necessary? Not absolutely. Some kinds of custom metadata can be changed via smart rules as well, Single-Line Text being a very useful type. So if you had another smart rule that would trigger when you imported an email, it could set the attribute for you. Following our example, you could use the File action and the Properties > Author placeholder to file things in a group named for the sender of the email. Or you could set a Boolean attribute, e.g., marking something as needing to be reviewed when you add a certain tag or label to a document.

And for scripters, check out the application dictionary for the commands: get custom meta data and add custom meta data. They both can be used in even more powerful ways!

* Custom metadata is a feature of DEVONthink’s Pro or Server edition.