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).