Hazel Rule to export new drafts to txt files

Anyone has made a Hazel rule that will export new drafts to a folder of choice as txt files?

I need to have Devonthink Pro 3 powerful index to search all my text files for research purposes, and love to use Drafts quick capture (rather dan Devonthink own clumsy Note taker), but I cannot point DevonThink 3 to the iCloud folder where Drafts are encoded, nor DT3 would understand that proprietary drafts format.

Thanks!

Hazel works on files, but Drafts’ drafts are held in a database, not in files. The only way you could have Hazel do something like this is if you were to periodically export any new drafts to a folder. At that point all the normal rules of Hazel would apply and you could use many of the import automations available for Devon Think at that point.

Fairly easy to do with a drafts action I think.

I have been looking at Actions in the directory and I have not seen one that can act on new drafts and export them as individual text files… yet.

I saw some actions to write to iA Writer, which handles md and txt files in its own iCloud drive folder (wish Drafts would do that!), but that is another intermediate step I wanted to avoid

You could select a set of drafts and batch run this action.

https://actions.getdrafts.com/a/1EW

Or this thread has a script you can put in an action where you can fill in a query to select which files to save to file.

1 Like