Drafts 4 for iOS: A Worthy Tool

When we think about iOS automation these days, we tend to think about Workflow.app, which is the most powerful and full-featured example of what a talented team of developers can do within the limitations of iOS. It is rightfully the King of Automation on iOS.

But before Workflow, there were a few apps that utilized the x-callback url schemes like Editorial and Drafts 1.

Drafts, A Great App to Start With Automation

The backbone of Drafts in the x-callback-url scheme created by Greg Pierce, the creator of Drafts, and Marco Arment, a famed Apple developer.

You can access your Drafts in the inbox. There are 5 tabs across the top: Inbox, Archive, Flagged, Trash, and All. These tabs are self-explanatory. I tend to flag drafts that I archive and want to come back to later.

If you trash a draft, you have the option to restore it, if you so choose, as shown here.

The premise of x-callback-urls are linking to other apps, and parts of other apps with a url and parameters.

For example, take this url:

drafts4://x-callback-url/create?text=Hello%20World&action=Copy%20to%20Clipboard.

The drafts4:// is the system url for an app. If you type this into Safari, it will open Drafts.

In this example, we are creating a new draft with create? and adding the url encoded text 2. Then, the &action is something we want to do with that text, which in this case, is copying the text, Hello World to the clipboard.

Actions

The power of Drafts is in the actions.

Actions utilize the x-callback-url scheme I talked about above to give you near unlimited possibilities for passing text around, which is the only thing it can do, whereas Workflow can tap into other system APIs for a drag and drop experience unmatched on iOS.

You can find some default actions within the actions panel in Drafts which you can get to by tapping the Drafts icon on the top right of the app.

You can have a near limitless amount of actions and you can chain actions together using the x-callback-url protocol.

If you tap the plus button in the Actions panel, you will be taken to a screen where you can create your own actions or visit the Actions Directory, where Agile Tortoise has compiled, with the help of users, a list of Actions that are freely available to you. Just search for an action and it will take you to the specified action’s page. Hit install and it will open up and Drafts and give you a prompt, asking if you would like to install it. Hit ok and it will be there for you to use in Drafts.

If you decide to make your own Actions, you’ll be greeted with a screen with a few options.

You can name, give a color to, and add steps to your action 3 , and adding them to Action Groups, which you can access in the Actions Panel. By default, your actions will be placed in the All tab.

Choosing Steps

Tapping on Steps brings you to a screen with lots of options, from Email, Clipboard, and Social actions, as well as cloud services.

You can choose whatever you like here, and Drafts will notify you on the Actions success or failure when you run your action. Check out the documentation to learn about errors and ways to chain actions.

Once you run an action, you can return to Drafts which is basically the callbackfunction of the protocol.

Advanced Action Steps: Action Sets

Action Sets are a whole other way to work with Drafts that makes it more powerful than it already is.

You can not only chain steps together you can create a prompt to prompt you to select an action you created and added to the Prompt menu, and Drafts will execute your choice.

So how do you do this?

The key to this is using this URL when you are creating new actions under the URL selection:

drafts4://x-callback-url/open?uuid=[[uuid]]&action=[[prompt_button]]

Here are the steps I took to create the set I have here:

Choose you action steps. You should choose URL and Prompt. But first, you should set up your prompt.

You will need to type in the actions you wish to add to the set the exact same as you have them in general, separated by a pipe character, or |.

The you set up the URL:

In the end, you should have something that looks like this:

Just Scratching the Surface

There are a lot of ways you can utilize Drafts in your workflow. I can’t cover them all here, but be sure to check out other articles on the topic.

How are you using Drafts? If you’re not using it, why not?

  1. Workflow, too, uses x-callback-urls in the best way possible. 

  2. Spaces in urls need to be url encoded

  3. Steps being url actions, chained together.