Does anyone know if it is possible to use an action script in Drafts to automatically select the draft which has the oldest ‘modified’ date in the inbox?
My scenario is that after archiving a draft, I would like to automatically select the next ‘oldest’ draft (by modification date), and work through the drafts from oldest to newest.
Take a look at the Draft.query() function. It can sort by modified date, and you can specify the order. Populate the query parameters to search the inbox too, and you’ll get an array of Drafts with the first element as the next draft you want. You then can load that in using the editor.load() function.
Is there a way to also have the query only select a draft that does not have a tag? I’ve tried a couple of guesses on how to not select a tag. But the only query that works ends up finding the oldest draft (which is correct) but that draft is also tagged (incorrect)
Side note @agiletortoise : this action using the Draft.query will crash Drafts on macOS -
Thanks for the link, it gave me a few more ideas, but none of them panned out.
I’m trying to create an action that would find the oldest Draft that has no tags so I can review for updates or trash it. The I have so far action works like I want, except for the finding the draft note I want.