Drafts Action Keys

Blogging from mobile devices require a little more effort to do those basic things you normally do on computer.

Things like searching and copying links from the web, browsing apps on the AppStore or, simply, previewing the Markdown you’ve wrote require a lot of taps on the screen.

And, if you’re a frequent iOS user, you probably use an external keyboard. This will translate in continuous movements from the keyboard to the screen, and vice-versa.

This, probably, slow down your typing and make the blogging pleasure a little painful experience.

Fortunately, with the last update, Drafts have included the Action Keys. This can speeding up those activities.

Combined with our friend Workflow, those keys can really become a powerful blogging companion.

#Extended Keyboard If you’ve already used Drafts in the past, you probably know the extended keyboard.

Its a row of customizable keys used for speed up the typing.


I’ve configured those keys with some convenient Markdown shortcuts and with the two arrows on both sides used for quickly moving the cursor without covering the text.

The Action Keys are little different: they don’t interact directly with your text, but execute some actions from your Action Groups.

Also, you can assign a keyboard shortcut to each Action Key, so you don’t need to leave your lovely keyboard to execute those actions!

At this time, I’ve configured three different Action Keys:


To configure an Action Key, you must configure a standard Drafts action in one of your groups (I’ve made a group named ‘Helpers’ in order to contain those actions), then configure the Key pointing to your action.

Here a brief description of my actions:

##Search web This action present a prompt, then open Safari and perform a query. Also, if you’ve selected some text on your Drafts document, this text will be presented as default query. Here the steps:

  • Script: get the selection (if any) and generate a new tag named ‘selection’ JavaScript var selection = draft.content.substr(draft.selectionStart, draft.selectionLength); draft.defineTag("selection", selection);

  • Prompt: present a prompt screen with (if present) a default query to search for: bash Key: query Title: Search: Include text field: enabled Default: [[selection]]

  • URL: open Safari and build the query for your favorite search engine. I use DuckDuckGo: bash https://duckduckgo.com/?q=[[query_text]]

I’ve also configured the Cmd b shortcut for this action. I choosed this shortcut because it’s the same used for quickly performing search on the web from spotlight on OSX.

##Search AppStore This is really similar to the ‘Search web’ action, and I use it for quickly searching in the App Store. It’s built with the same three steps as before, but the URL built in the last step it’s (obviously) different:

  • URL: open AppStore app and search for the choosen text: bash itms-apps://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?media=software&term=[[query_text]]

I bind the Cmd S combination to this action, where S mean ‘Store’ :D

##Preview Markdown This just launch the Drafts default ‘Markdown Preview-Swiss’ action, in order to render the typed Markdown.

I’ve binded Cmd P to this; as you can imagine, P mean ‘Preview’

#More automation We just achieved a lot, speeding up our blogging process, but what we have to do after we found what we need on Safari or on the AppStore?

We can just use our friend Workflow!

In my previous post I provided a workflow which pick up a link, ask for the label, and generate a Markdown style link.

It’s called Copy as MD Link and works either from Safari and from AppStore (probably, it works from a lot of other applications, but I never tried it yet).

#Conclusion So, imagine you are write your next great blog post from your iOS device, with your favorite external keyboard.

When you have to link a website, you can just hit Cmd B, enter some words from the article you want to link and hit Enter.

Automatically Safari will be opened, and perform your query on your favorite search engine. When you found what you need, tap the share button, Run ‘Copy as MD Link’ workflow, enter the label and… you’re back to your draft. With a simple hit of Paste (or Cmd v) you add the information to your article, minimizing the effort needed

Probably, more efficient automations can be built. If you think I’ve miss something, or you want to share your better automation, feel free to reach me via twitter (@mcappadonna).

Written on May 19, 2015 - #Drafts #Automation #iOS