Hi,
I have a group in which I have a set of pdfs to be reviewed by me. I highlight portions of the pdf , then run an AppleScript which generates a markdown of the highlights, copies the md file to Obsidian and then moves the PDF to another Group. I have a smart rule on this group which goes like this -
Now , interestingly the smart rule doesn’t get triggered when the PDF is moved into the group by the script. However, if I move the PDF to another location and move it back, the smart rule gets triggered.
I’m moving the PDF file from one DB to another . I changed the condition to “On Moving” from “on moving into database” - same result. The smart rule is not triggered
Scripts don’t trigger smart rules IIRC; this is to avoid infinite loops and other unexpected behaviour. The script can activate the on move trigger for the item if you add the following line, though: perform smart rule trigger move event record theRecord (assuming theRecord is the variable you have chosen for the item in your script).
Edit: I think that currently won’t work; perform smart rule won’t run from within a “performSmartRule” script handle; again, if I understand the mechanics correctly, this will be changed in the next release.
Edit of the Edit: whilst the dictionary still says “NOTE: This can’t be used in “performSmartRule” script handlers of smart rules.”, the change in behaviour was implemented in DT 3.8.4, so actually it should work (@cgrunenberg is the dictionary in need of update?)