Is it plausible to create an action that would open a draft in another application, and when that application saves changes to the file, the change is made to the draft?
I’ve been using Drafts for a while, mostly on macOS. TBH I make very light use of actions. Don’t know anything about creating them. Drafts mainly serves as my preferred NValt-type alternative.
What I really want to do is have an action to open a draft in FoldingText. Use the lovely folding features there, and then when I’m done it saves the markdown back to my original draft in the Inbox.
Does that make any sense?
The answer I think is kind of, sometimes, but certainly not always.
Drafts does not use files to store notes. It uses a database, and nothing else is ablate read and write directly to that database. At least not if they are a good actor and following Apple’s security good practices.
What you could do is pass the content to another app, have that app modify the content, and then pass that content back to Drafts along with what draft should be updated with the passed in content, triggering a draft action at the same time to apply the update (or via some other external automation mechanism).
So while it can be done, it isn’t done exclusively with files like you would see in NValt, it isn’t exactly a trivial task to do, and it may require additional apps depending upon the destination app for modifying the content.
If the destination app supports x-callback-url, this may simplify things, but not every apps supports this.
In terms of FoldingText, it looks like it supports AppleScript, so you could probably build something with that to trigger the save back to drafts by a URL call to trigger an action or even just the replaceRange
URL scheme option that Drafts supports. You could store the UUID of the draft at the top of the text and parse that back out in your AppleScript.
Hope that helps.
1 Like