Open draft in a Mac external text editor (TextMate, Sublime, Atom, VS Code …)

I would like to create a one-click action to open a draft created in Drafts in an external text editor like TextMate, Sublime, Atom, or VS Code. I would be happy to make either an “Edit in …” or “Export to …” action.

The “Share” and “Export” actions don’t seem helpful here. Nor do I see how to accomplish this when creating an action with the “Open in …" and “Export” step types.

One shortcut might be to script opening the file in whatever the system’s default text editor is. Another might be to go through Bash, where actions exist to open files in those apps like mate filename or atom filename on the command line, but I think Sandboxing prevents that integration.

(Adding: I realize that Drafts is itself an editor. Why would one want to do this? Text that begins in Drafts might become part of a LaTeX document or a Hugo/Jekyll website, or something else more complex than Drafts knows about.)

Any hints?

I’ve not tried this myself, but I would think that you could create a Quick Action or Service via Automator that would allow you to send content into another app from anywhere. Not just Drafts.

This Sublime Text example might help.

Failing that, Keyboard Maestro would provide options where you could trigger manual actions to push text around between apps.

Hope one of those options helps.