Tweet This Post

I wrote the above Launch Center Pro action over the weekend. I thought it would take 15 minutes, but it took 45, because the encoding was such a challenge.

The Problem I Wanted to Solve

When I add new list items to an LCP action using the list tag, I sometimes just randomly add an item after the first pipe (|) I can find. Then I notice that the order of my list items has no rhyme or reason to it, so I want to alphabetize it. This is not an easy task, cut-and-pasting in a small text area on an iPhone screen. So I decided to use TextTool to automate the process for me.

  1. Remove the pipes in a sequence like Apples|Pears|Bananas using the split method.

  2. Use the sort method to alphabetize the list

  3. Add the pipes again between each item, using the join method.

Here is the full LCP action (click on the link in the Twitter embed above to install):


The sort transformation, URL-decoded:


The join transformation, URL-decoded twice:


Notice how, even though this action was URL-encoded twice after the second x-success parameter, the [[output]] had to be encoded yet again before the entire action was URL-encoded twice. I had to add an extra %25 before each double-encoded bracket to make the complete action work.

Related: Take a Photo, Get a Markdown Image Link with Launch Center Pro, Clean Links, and TextTool

Resources: TextTool x-callback-url Support page

02/03/14; 10:33:23 AM

Tweet This Post

Paperless is an iOS lists app that stores its data in XML files in Dropbox (if you choose to sync). What follows is an attempt to procure the first item in a list and send it to Due without having to copy and paste.

The first list item in any Paperless list appears to occur on line 12 of the list's XML file. It looks like this:

<itemName>LIST ITEM</itemName>

Launch Center Pro's dropbox tag lets you get the contents of a text file, so I figured I could grab the entire contents of an XML file and push it to Drafts. Tap on this link to import into LCP, or copy the action below and adapt for your purposes:


What this does is grab the full text from the Errands list in Paperless, send it to Drafts, and then activate the line12 custom URL action.

line12 uses a Drafts tag [[line|12]] to send line 12 of the XML file to TextTool and then use the regex method to replace <itemName> and </itemName> with blank spaces. I know next to nothing about regex, but I found here that I could easily create a regex expression to match both <itemName> and </itemName>:


So the search parameter in TextTool is the above URL-encoded, and the replace parameter is a single space, URL-encoded:


(Tap on this link to import into Drafts.)

The x-success parameter above tells TextTool to take the [[output]] of that transformation and send it to Due. Here is that action URL-decoded:


The final result... I tap on the LCP action, and it adds the first list item from my Errands list and sends it to Due. There are spaces preceding the text, but the XML is extracted.

Although the automation required to perform the above is a bit excessive (in contrast to just copying an item from Paperless and then pasting it into Due) it demonstrates the ability of the included iOS apps to accomplish pretty remarkable tasks.


Addendum (2014-02-04)

Here is an importable line12 Drafts action that trims the TextTool regex output before it sends the list item to Due. And here is the URL action itself:



Addendum 2 (2014-02-04)

Here is an importable line12 Drafts action that will include a link to the Errands list in Paperless within the Due text, so that when you complete the task, you can visit the list and check off the item there. (Thanks to @epramono for inspiring this.) And here is the URL action itself:

02/03/14; 12:47:01 PM

Last built: Mon, May 12, 2014 at 8:52 AM

By Jeffrey Kishner, Monday, February 3, 2014 at 10:33 AM.