Extract Text from an XML File Using Launch Center Pro, Drafts, and TextTool

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:


Last built: Tue, Mar 31, 2015 at 2:05 PM

By Jeffrey Kishner, Monday, February 3, 2014 at 12:47 PM.