jarrodwhaley.com

I make films. I'm also a nerd.

Link-Blogging With Drafts And Pythonista

I write about the useful aspects of both Drafts and Pythonista quite often. The fact is, these two applications (with a little help from TextExpander, naturally) make writing on iOS almost as easy as writing on a Mac. I have found a few key ways to use them to automate tasks which used to be tedious on mobile devices; my life is a lot simpler as a result.

One example–and it’s something I often use multiple times per day–is a combination of a Safari bookmarklet, a Pythonista script, and Drafts. It was developed by iOS automation-nerd Federico Viticci, and originally shared in his oft-refenced Macstories post “Automating iOS: How Pythonista Changed My Workflow“. Its inputs are: 1) text selected by the user on a Web page, and 2) that page’s URL. It passes those inputs through Pythonista, and then it shoots them over to Drafts. The output of Federico’s workflow–i.e. the new object in Drafts–consists of the user’s selected text, followed by the URL preceded by “From: “. I love it as a means of quickly getting started with a “link-blog” style post, in which a source is cited, and then a block quote is given. However, I had one small problem with the Python script: the link was injected after the block quote, and none of the output was formatted as Markdown. It just didn’t fit the way I want to write. So I tweaked it.

If you’re not already using the workflow, you can read all about it in Federico’s post1; everything here will work exactly in the same way. The only difference is the Pythonista script:

Now the link will be formatted in Markdown syntax, and the clipped content will follow it, properly formatted as a block quote. Link-blogging on iOS is even easier this way.


  1. I’d link directly to the workflow if it were possible; unfortunately, you’ll just have to scroll down and find it.