Blog

Overview Title

iOS workflows for org-mode

5

Although MobileOrg is a very interesting project, I don’t find it very attractive compared to many other iOS productivity applications. It is indeed handy when I need to search something that I know I stored in org, but there are much better option to quickly capture ideas and tasks. This said, it is not difficult to hack into the org-mobile architecture, sharing the sync stuff already in place for MobileOrg (I used Dropbox for that).

I have started hacking some simple workflow to help me quickly enter notes and tasks into org, and to add URLs that I want to check out later. I use the following tools:

  • Pythonista: A great tool, incredibly well thought and implemented. Basically, it is a fully functional python IDE, very well integrated into iOS. Worth its price in gold!
  • Drafts: A plain text and Markdown editor, very much oriented toward automation. Drafts makes it very easy to interact with files stored on Dropbox.
  • Launch Center Pro: Not strictly necessary, but it makes it easier to start actions on the other apps.

The problem

I often read news (using Sunstroke, with a self-hosted instance of Fever) and emails on the iPhone, when I’m idle or waiting for something. Often I found interesting things that I’d like to explore further, or actionable emails. What I used to do for links was to copy the URL, go to MobileOrg, capture a note with some text and the link itself. I had no good way to deal with email messages, I just used to mark them unread, to be processed when back on a computer.

The solution (workflows)

Links

For interesting URLs I have prepared a simple python script which visits the page, extracts the title, and format a note in the same format used by MobileOrg (including a unique ID and a timestamp). After completing this, the script starts a custom action on Drafts, which appends the output to the MobileOrg.org file in my Dropbox. The python script is the following:

I also have two custom actions on Drafts:

  • An action which runs the python scripts using the Pythonista URL scheme;
  • An action which appends the output of the previous action to the MobileOrg.org file in my Dropbox.

You should be able to import these actions by clicking on the links from an iOS device with Drafts installed. Note that the Pythonista action expects the script to be in a folder called “org”.

Finally, if you want to start the workflow from Launch Center Pro, you can use a custom URL action with the following URL:

drafts://x-callback-url/create?text=&action=URL%20to%20Org%20Inbox

This assumes that your action in Draft is called “URL to Org Inbox”.

Notes

It is easy to add notes to MobileOrg from the app itself, but it is so much more enjoyable to type on Drafts… I have slightly changed my python script, so it creates a note using the title and body of the text I have typed in Drafts itself. Here is the script:

Here is the Draft action that I use (again, for this to work the Pythonista script must be in a folder called “org”).

Email messages

I have always found quite annoying not having the “message://” URLs on iOS. They are now available on iOS 7, still there is no easy way of creating them from Mail.app. I ended up trying several third-party email apps, and I finally I really like Dispatch; in Dispatch it is easy and fun to process several emails quickly, and the app can generate custom URLs which link back to email messages. The developers published a tool to make the custom URLs accessible on a Mac as well. Dispatch can send a message’s URL to several productivity apps, or just copy it to the clipboard.

If you want Emacs to manage correctly Dispatch URLs, you need to add the custom link type. Adding the following lines to one of your startup files will do:

You may notice that I have not used Dispatch’s custom URL, but I am using the standard “message:“. This works (the message ID is unique), and it does not require you to install the helper required to open Dispatch’s URLs.

This is still work in progress, as I need to modify slightly the python script (so it does not try to visit the URL to get the title).

Credits

Although the python scripts are original, many of the ideas here come from the work of Federico Viticci of MacStories. Have a look on his blog if you want a good idea of everything you can automate on iOS.

Next steps

I hacked these scripts and actions while on the subway, I know they are neither well designed nor well implemented! When I have more time I plan to clean everything up, create a proper bookmarklet to process a link directly from Safari or Chrome, and complete the workflow for emails. Now that I have tried it first hand, and seen how easy it is to automate stuff on iOS, I guess I will have many other ideas and use cases.

Let me know if there is interest for this and I will keep sharing.

  1. Kyle Sexton
    Kyle Sexton11-04-2013

    Thanks, implemented these and love easily getting notes from mobile back into org.

  2. John Burns
    John Burns04-20-2014

    Having just started using an iPhone 5s, I am interested in how to find easy ways to get notes back and forth from org mode to mobile org and back again. Also interested in getting tasks to and from org mode into mobile org.

  3. Stoph Long
    Stoph Long02-08-2016

    Hi,

    In case you are interested, I wrote some editorial ios app (http://omz-software.com/editorial/) and org (http://orgmode.org) related functions as a proof of concept. You can check out my screencast for more info (https://youtu.be/JclQcwc2iJs). They work well for my needs. Still, please back up your work before using as I make no guarantees. Perhaps they’ll work for you or get the ball rolling. I’m sure there are better programmers out there who can bring this to the next level. And here’s the link to the descriptions:

    https://forum.omz-software.com/topic/2023/feature-org-mode-support/10

  1. You Know What? | Bread-Nauseam01-18-15
  2. App for editing files in my Dropbox? | Some iPhone Questions and Answers07-06-15

Leave a Reply

Thanks for the visit, please come back again