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?

1 Like

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.

Would this be a feature that could be baked into Drafts or is it not possible because of how Drafts is developed?

I’m in the same boat. I love starting text with Drafts for its quick capture, and I would prefer storing the final version in Drafts because of how it can organize text. Creating text without having to save to an existing file or create a new file is a huge advantage. However, there are many times I need to do some heavy lifting or edit lots of text within a large document, so I use Sublime Text for this task. Instead of copy/paste back and forth and sometimes leaving pasted duplicates floating around, I would love to right-click Edit Draft in (insert text editor), but I don’t know if this is wishful thinking based on how Drafts is developed.

You could try this action which I think does about what you suggest here. A bit hacky but seems to work well for me so far.