TIP: Publish a Workspace to Files with Shortcuts

In iOS 15 (and macOS 12), Shortcuts added file actions which make it easy to work with files and folders. Combined with Drafts extensive ability to query your drafts, it is easy to create publishing shortcuts - so we thought we’d provide a basic example that might be useful as a starting point for some of your own workflows.

The “Publish Workspace” example shortcut does the following:

  • Prompts you to select one of your Drafts workspaces.
  • Fetches drafts in the inbox of that workspace.
  • Prompts you to select a destination folder.
  • For each draft found, saves a Markdown file in the selected folder with the content of the draft, named using the first line of the draft (e.g. Title.md).

To use this example you must be running iOS 15 or greater, or macOS 12 or greater.

Install the Shortcut: Publish Workspace

Once installed, it is easy to modify this shortcut to suit your needs. You can pre-select the workspace, for example, or modify the file-naming scheme to your liking.

5 Likes

Very nice! The one variant I’d actually use is if there were a list of the drafts and you can select which one(s) get(s) published…

… My workflow for blogging is to write a post in Drafts and save as Markdown to a directory and convert that to HTML. Usually one draft at a time.

Just putting in a choose from list action with multiple select set to on should get you that, I think.

1 Like