Turns out nor do I the embedded script canāt handle the date
command (oh, yes, I remember). Iāve ācleaned upā and simplified the script now and attached it here zipped. You need to unzip it, and then add the script file to DEVONthinkās (DT) smart menu script folder like so: in DT click on the script icon in the menu (itās on the left of the Help menu); select āOpen Scripts Folderā; it contains a folder āSmart Rulesā; drop the script in the folder āSmart Rulesā.
Now when you set up a smart rule and as the action select an external script, you will be able to select our new script called āAuto-Add as Reminderā from the dropdown list.
Whether or not you use both the internal and external reminders is up to you of course. Your smart rule can run both scripts.
I have actually tried all those steps now, and it works for me. Sorry for not having tried the previous script embedded, then I would have noticed myself that it wasnāt going to work without modification.
As I said, your rule needs to make sure it only runs on each file once (otherwise youāll have lots of remindersā¦); if you set up a custom metadata (DT preferences/Data; Iāve called mine āIsReminderSetā), then you could set your rule to look like this:
Obviously, you might want to change on which group the smart rule acts. You might want it to trigger āAfter Synchronisationā if you are adding items to the group with DTTG on iOS. As a one-off, you may also want to set the āIsReminderSetā to 1 with a smart rule on all files already in the folder which is acted on by the smart rule, just so as you donāt get reminders for that which is already in there today.
If you open the script, you can change both the point in time of the reminder (currently one week on the future at 08:00) and the reminder list - both parts of the script are marked with a comment. Note: DT caches the scripts on startup, so any changes you make to the script arenāt reflected until you restart DT.
Auto-Add as Reminder.zip (5.9 KB)
Try it out - again, Iām not going to be responsible for the script taking meth and playing loud music, but itās not done any harm here Let me know if you run into any problems.
And thanks to all those who have helped me code these past few days - the great thing about knowledge is we all have differing degrees and selections of it, and can share and help out.
As homework, you could try and integrate writing to metadata into the script - that way the metadata bit would only be set if the script is actually successful - currently, if it failed with an error, then the bit would still be set, and the script wouldnāt run on that file again (which in practice probably actually wonāt be a problem).