Importing Activities from OmniFocus or Things to Pomodoro App
Tuesday, March 1, 2011 at 9:14AM This article is split into two parts: The first one describes the technical background of our Dropbox integration, the second one shows the steps to import activities from OmniFocus or Things to Pomodoro App. Feel free to skip the background information if you just want to get started. :)
Background
One of the new features of Pomodoro App 1.3 is the integration of the Dropbox API. It currently serves as a simple mechanism to backup activities or move them to a new device, but you can actually also use it import activities from your Mac or PC.
When the app creates an export, it writes a JSON file to the folder "Pomodoro". The file is named after the unique identifier of your iPad, so that every device creates exactly one file. On the way back, the app imports all files with the extensions .json from the same folder. The JSON file looks like this (JSON is human-readable so you can read and edit the files with your favorite text editor):
[
{
"pomodoros": [
],
"estimate": 4,
"list": 0,
"interruptions": [
],
"subposition": -1,
"position": 184,
"updatedAt": "2011-02-27 11:05:24 +0000",
"state": "active",
"identifier": "23AF0D78A25FB08AC7F7319C4BCCCC8B",
"title": "Multi-line edit of expense text"
},
{
"pomodoros": [
{
"createdAt": "2011-02-27 10:40:24 +0000",
"length": 1500
},
{
"createdAt": "2011-02-27 10:04:22 +0000",
"length": 1500
}
],
"estimate": 3,
"list": 1,
"interruptions": [
{
"external": 0,
"createdAt": "2011-02-27 10:05:31 +0000",
"internal": 1
}
],
"subposition": -1,
"position": 183,
"updatedAt": "2011-02-27 11:05:24 +0000",
"state": "finished",
"identifier": "23AF0D78A25FB08AC7F7319C4BCCCC8B",
"title": "Add view for manual categorization"
}
]
Here we have two activities: The first one is in the Inventory, has the title "Multi-line edit of expense text" and an estimated number of four Pomodoros. The second one is in Today's list, has the title "Add view for manual categorization", an estimated number of three Pomodoros, but also two executed Pomodoros and one internal interruption. Moreover, it is marked finished.
You could edit this file, change the titles or estimates and then reimport it into the app. Although this would work, we recommend against it as the exported file might be pretty big and the process is error-prone (e.g. if you forget to create a new export and edit an old file instead, you would overwrite newer data such as Pomodoros or interruptions). A better solution is to create a new file in the same folder and rename existing files (e.g. to old.json.bak) so that the app only imports the new file. When creating the new file, you only need to specify 3 fields: title, estimate and list.
[
{
"estimate":3,
"list":0,
"title":"New Task 1"
},
{
"estimate":2,
"list":0,
"title":"New Task 2"
},
{
"estimate":4,
"list":1,
"title":"New Task 3"
}
]
Save the file as tasks.json, then tap "Import" in the app and it will create three new tasks: "New Task 1", "New Task 2" and "New Task 3". The first two are put into the Inventory (the field "list" is 0) and the last one into Today' list (the field "list" is 1).
AppleScript from Zettt
10 days ago, our local developer group had its monthly meeting. One of the members is @zettt, who creates great screencasts at Mac OS X Screencasts and saw Pomodoro App at this meeting. After some time playing with it, he came up with the question whether it would be possible to import his tasks from OmniFocus into the app. We discussed serveral ways and did some collaborative hacking with AppleScript, which resulted in a blog post from Zettt and two script files: The first one works for OmniFocus or any content from the Clipboard (one task per line); the second one takes all selected tasks from Things. You can use them as follows:
- Download the script for OmniFocus or Things.
- Extract the downloaded .tar.gz file.
- Open the .scpt with a double-click.
- Switch to OmniFocus, select a number of tasks and copy them to the clipboard (Cmd-C); or switch to Things and just select a number of tasks.
- Switch back to AppleScript and hit the "Run" button. The script should detect the selected tasks and bring up a small dialog to input the estimated number of Pomodoros for each for it.

- After the last task, the JSON file is created in your Dropbox.
- Take your iPad, open Pomodoro App, tap the settings button, then Dropbox > Import. After the import is done, you should see your new activities in the Inventory.
If this does not work for you, please let us know and leave a comment or give us feedback via our contact form or email.
Codenauts |
11 Comments | 
Reader Comments (11)
Thanks for getting this up so quickly! I tried following the instructions, but I keep getting a syntax error message that says "Expected expression but found unknown token." When i scroll down through the script I see the question mark in the diamond shape highlight. What could be going wrong?
--Ashleigh
This will not work if we're running both Things and Pomodoro off the Ipad (b/c no applescript for ipad yet), right?
@Shannon: No, there is no AppleScript for iPad. You have to sync your iPad with your Mac or use Copy & Paste on the iPad.
I would love to get this working, but it isn't quite working right for me.
Everything is good except the title. It seems to not export the name of the todo in Things. Opening up the .json file reveals:
[
{
"estimate":23,
"list":0,
"title":""
}
]
As you can see, I was testing it out and it got the 23 pomodoro's right, but it doesn't export the title of the ToDo. When importing the file from the Pomodoro for iPad App, it adds it but again, has no title.
Any help would be great as I would love to get this set up!
Thanks a bunch!
Justin
@Justin: Which script are you using, the one for OmniFocus or the one for Things?
Hi there,
thank you for nice and excelent pomodoro app for ipad. I am using OmniFocus too and was excited about applescript for transfer tasks from OF to you ipad app. But when I try to import tasks.json, activity invetory is empty. Nothing happens. When I look into .json file, everything is ok.
Any suggestions? I am following steps as described in you blog post. Is it possible, that the problem is I am using Lion?
Thank you for you answer.
@Patrick: It should work with Lion the same as it did with Snow Leopard. Can you send us your tasks.json via email to info@codenauts.de so that we can check the file and import process?
@Codenauts: Thank you, no need to sent you taks.json file, I have just made it to work. :-) Miracle. :-)
I only have Omnifocus for the iPad and I use pomodoro on the iPad (and love it) too... is there any way that the sync can work between the apps - maybe via iCloud?
I know it's probably asking a lot - but I'd be happy to hassle Omnifocus as one of their customers too if that helps?
@Paul: Sadly it is not possible to exchange data between two different apps via iCloud. Maybe Apple will provide an API for this in iOS6, but right now there is no way to do this.
I've modified a script version a bit to allow to copy items from Omnifocus without clipboard. https://gist.github.com/1769115
The script copies selected items or if no items selected flagged items.