jarrodwhaley.com

I make films. I'm also a nerd.

Posts Tagged ‘TextTool’:

Easy URL Encoding on iOS

Occasionally it’s necessary to encode some text on iOS for easy insertion into a URL. It’s annoying enough trying to type out all of that word%20word%20word%20word gobbledegook, and it’s particularly painful trying to do so on an iPhone, since you have to dig down to the third keyboard in order to get to the % character. I came up with a couple of easy solutions to the problem using Drafts, TextTool, and Editorial.

  • The first method is a Drafts URL action which will send the text of the current draft to TextTool, properly encode the text for use in a URL, and then send the text back to a blank entry in Drafts:
    texttool://x-callback-url/transform?text=[[draft]]&method=encode&x-success={{drafts://x-callback-url/create?text=[[output]]}}
    
  • The second method is a workflow for Editorial which uses a Python script to replace the selected text with a URL-encoded version of the selection. Just install that workflow and fire at will.


UPDATE, 4:21 PM: Over on ADN, Jeff Mueller posted a handy permutation of my Drafts action for Launch Center Pro:

texttool://x-callback-url/transform?text=[clipboard]&method=encode&x-success={{launchpro:}}

Thanks, Jeff!