I have a short AppleScript program that, among other things, creates a new document from a template:
set newRecord to import templatePath to current group
In DEVONthink 3, I also have a Smart Rule with a trigger condition “on creation” and “on import”:
Despite this, the rule does not trigger when a document is created using the AppleScript code. The rule does work when I create documents using Data ➜ New from template with the same files that my AppleScript code uses. Also, there is nothing special about the template files – they’re just files, without scripts within them.
What is the correct way to have the Smart Rule trigger in this situation?
Smart rules could make the results of scripts and smart templates absolutely unpredicatable (both for users and support)
The intention of scripts and when an action is complete and the rule should be triggered therefore is unknown. However, since version 3.5 scripts or smart templates can use the perform smart rule command to add support for smart rules.