How do I make a smart rule that runs when an item is moved to a specific folder?

When I receive a credit card statement that needs paying at the end of the month, I set a reminder that runs once on the last day of the month, with an Open Externally action.

My process involves using the Imprinter, which generates a copy of the document. I can then delete the non-imprinted version. However, after I just installed the update to DT 3.8.7, several old documents opened themselves again.

I would like to create a smart rule that clears the reminder when an item is moved to the Trash (or any folder where credit card statements get filed), but setting “Perform the following actions” to “On moving” doesn’t provide me with an option to specify which destinations it should apply to.

I don’t want to clear the reminders on every document each time I move them!

I can’t see a “Folder” option in the criteria list, either:

Come to that, I can’t see a “Remove Reminder” action — or any way of setting them:

Is there a way to do this without having to write AppleScript?

(This would actually be unnecessary if a reminder set to fire once cleared itself after it had fired. The original documents opened to remind me to pay them — I know this by the lack of threatening letters :grin: So why was the reminder still hanging around and in a position to fire once more? Once means once…)

It would also be nice if I could use “Has Reminder” as a criterion for a smart group — at least then I’d be able to find them easily to clean them up myself.

There’s actually such a condition, it’s Item contains Reminder (or item:reminded via the toolbar search).

1 Like

There are no folders in DEVONthink; there are groups. This is also not mere semantics as it’s also how we distinguish items in DEVONthink versus the folder, e.g., you index a folder in the Finder and access the indexed group in DEVONthink.

Thanks — I didn’t spot “Item” in the menu. That’s solved the smart group!

Oops — good point. Thanks!

I think part of the problem I’ve had is thinking that “On Moving” triggers when something’s moved from the specified group; it triggers when it’s moved to that group, of course.

I’ve managed to get everything working with a rule that triggers on moving to any subfolder of Credit Cards, and executes this AppleScript (once I managed to find documentation on how to clear a value in Applescript — DuckDuckGo is getting worse at matching search terms, it seems!)

image

BTW, the AppleScript colours are still pretty illegible in dark mode, especially the dark blue on black :slight_smile:

Where? In script Editor or somewhere else?
(I’d simply not use dark mode, btw. It is in general not a good choice for legibility, imho)

1 Like

The script editor, after it’s parsed it.

I find “dark mode for code, light mode for prose” to be best for me — at least when sane colours have been picked for dark mode!