The perfect synergy between 1Writer and TextTool

1Writer is the most powerful text editor available for iPhone, not ranking likewise on iOS as a whole due to Editorial in the iPad. The most impressive feature of 1Writer is its support for custom actions, which I wrote about previously. This week 1Writer gained a new best friend in the form of TextTool, an app by Craig Pearlman that does text transformations.

TextTool will take your text and transform it with the 28 different tools it supports. You can change the case, encode or decode, add or remove smart quotes, hyphens or others, join or split into one line or by delimiter, find and replace with regular expression (!), and many other cases. You can find the whole list of text transformations here.

Put that together with 1Writer and you can quickly edit your text and send it back using its replace parameter, which requires the path and the name of the document, 1Writer doesn’t render the first automatically, but it can send the document name with extension using the [name] tag.

Unfortunately, TextTool doesn’t let you open the text, edit it and apply the x-success parameter afterwards, maybe when Craig implements x-source. You can also use Open in... to take the text entry to another app, but that generates a new document, something you don’t actually want if you sent text to TextTool from somewhere else, that’s why we’re using replace.

Talking about replace, using the same parameter, [name], you can send text selections from 1Writer to TextTool, however, since we’re using replace on the callback, it would swap our entire document for the output from our selection. This could be avoided if 1Writer supported the proper callback, as it does with Terminology. Considering the dedication of the man behind 1Writer, I wouldn’t consider this possibility so distant.

Let’s talk about a cool action, shall we? This one will take your text from 1Writer, send it to TextTool and transform it using the entify tool, which converts unsafe HTML characters to their proper HTML entities.

Entify on TextTool:


We use the [name] to tell TextTool which document to return. The path and type are predefined, the one in the example above refers to a file inside the local folder Documents. On the callback, we use [[output]] to send the transformed text back to 1Writer. But there's another way to achieve the same result with the clipboard and less parameters1.

Entify with TextTool:


How this one works? If you don't use the clipboard=0 parameter in TextTool, it copies the output of the transformation to the clipboard. If you don't add the text parameter in 1Writer, it uses the clipboard content to generate the document. Damn, this is like Mister M all over again.

  1. All credits for this one goes to Ngoc Luu, the 1Writer developer, who showed me that local folders require the type parameter and that I wouldn’t need the [[output]] from TextTool thanks to the clipboard trick. Thank you.