TextTool, a new iOS app that transforms text in various ways, has just been released in the App Store. MacStories has an informative article on it. Federico wrote a Drafts URL Action to turn a list in Drafts into a Markdown-formatted list using the
affix method in TextTool, and then send that text back to Drafts using x-callback-url.
Frequent readers know I am OPML-obsessed. (OPML is a structured data format for outliner software.) In May, I wrote a complicated set of Drafts actions to convert a list in Drafts into an OPML file. With TextTool, this solution become a whole less complicated. TextTool allows me to to affix a prefix of
<outline text=" and a suffix of
" /> to every line imported from Drafts, and then send that text back to Drafts. I then can use a Dropbox action to put the draft text into a template surrounded by the OPML header and footer to create a valid file (which can then be imported into an app like Fargo).
Import the Drafts Actions
If you’re reading this on your iOS device, tap on this link to import the
texttool-opml URL Action into Drafts. (You must of course have both Drafts and TextTool installed on your device.)
The URL Action itself looks like this:
action at the end of the x-success parameter tells Drafts to then perform the
textool-opml-dropbox Dropbox action. Tap on this link to import it.
It essentially wraps the [[draft]] with the text required to make it a valid OPML file.
Type of Action: dropbox
<?xml version="1.0" encoding="UTF-8"?> <opml version="2.0"> <head> <title>[[date]]</title> </head> <body> [[draft]] </body> </opml>
How It Works from Beginning to End
If I enter the following into Drafts and then tap on
Line 1 Line 2 Line 3
it will send an OPML file titled
2013-11-21.opml to the /Apps/Fargo folder in Dropbox:
<?xml version="1.0" encoding="UTF-8"?> <opml version="2.0"> <head> <title>2013-11-21</title> </head> <body> <outline text="Line 1" /> <outline text="Line 2" /> <outline text="Line 3" /> </body> </opml>
I can then open this file from within the Fargo app.
You can customize this in many ways. For example, if you like Carbonfin Outliner, use the Dropbox action to send it to the /Outliner folder and then sync the iOS app to import the file.