The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   A faster export of all active OmniFocus task to OPML (http://forums.omnigroup.com/showthread.php?t=25421)

RobTrew 2012-09-10 01:12 AM

A faster export of all active OmniFocus task to OPML
 
2 Attachment(s)
There has been [URL="http://bettermess.com/omnifocus-to-mind-map-using-opml-a-geeky-cry-for-help/"]some recent discussion[/URL] of exporting all active OmniFocus tasks to OPML for review in mind map software.

[URL="http://forums.omnigroup.com/showpost.php?p=100455&postcount=4"]Another script[/URL] on this forum (originally intended for exports of GUI-selected projects and tasks) can more or less be cajoled into exporting the whole set of active data, but takes several minutes to do this through the Applescript interface.

Here is a script which takes a different approach, using Python to read the Sqlite cache.

[B]Note: requires OS X 10.7 and above (Python 2.7)[/B]

The export now only takes a second or two on my system, but in the current version only exports (by default) the names and notes of all the active folders, projects and tasks (i.e. it's currently skipping dates, contexts etc).

If you edit the following line at the top of the script:

[CODE]property pIncludeLinks : 0 -- 0 to omit links to OF tasks, 1 to include them[/CODE]

You can request the script to include links of the form:

[CODE]omnifocus:///task/o49Lh0LPVjA[/CODE]

On the iPad, iThoughtsHD will then link each node to the corresponding task in OmniFocus for iPad. Holding a finger down on the iThoughts node for a second or two will enable you to jump straight to the relevant task in iPad OmniFocus.

Why not include export of links as a default ?

Well, including links will mean that every iThoughtsHD node has a tiny green globe at the corner (haven't found a way of switching this off :-) and will add few seconds both to the initial export from Desktop OmniFocus to OPML, and to the time it takes iThoughtsHD to read the OPML in.

A pre-alpha draft. Suggestions and bug reports welcome.

[COLOR="White"]--[/COLOR]

RobTrew 2012-09-10 01:37 AM

PS Any links in your OmniFocus notes to DevonThink records, should also work after OPML export to iThoughtsHD (if you have the corresponding records in DevonThink to Go on your iPad) regardless of the link export setting in the script.

RobTrew 2012-09-10 03:58 AM

And finally, one could tame it visually, bringing the branches in pre-folded to the preferred level, and with a preferred colour-scheme, by exporting from OmniFocus straight to the native iThoughts file format.

Perfectly feasible, and it's possible that Craig Scott, the iThoughts developer, may do that at some point – OmniFocus import is apparently somewhere there in his list of things to look at.

(In the meanwhile, I may do an interim sketch of it if I get some time in the next few weeks).

viticci 2012-09-10 05:24 AM

Thanks Rob, worked really well for me. Two requests:

- Would it be possible to save the OPML file automatically without open/save dialog? This way, I should be able to automate the process to run every x minutes without seeing the dialog.

- Any way to detect whether a task is recurring, and offer an option to see the recurring information (ex: every 2 weeks) as a note?

Thanks again.

RobTrew 2012-09-10 07:37 AM

[QUOTE=viticci;114373]- Would it be possible to save the OPML file automatically without open/save dialog? This way, I should be able to automate the process to run every x minutes without seeing the dialog.[/QUOTE]

Various ways of doing that. If you are happy with the command line and simple shell scripts, you could fish the Python file out of the resources folder in the .scptd bundle, make a copy in your home directory, bypass Applescript altogether and use a command line like:

[CODE]python "$HOME/ofoc_sqlite_to_opml_005.py" "$HOME/Dropbox/CurrentTasks.opml" 1[/CODE]

(Or a final zero in lieu of 1 to suppress export of links).

[QUOTE=viticci;114373]- Any way to detect whether a task is recurring, and offer an option to see the recurring information (ex: every 2 weeks) as a note?[/QUOTE]

Various requests are coming in for additional/alternative selections of data, I'll review them all and think about the options in a week or two.

[COLOR="White"]--[/COLOR]

viticci 2012-09-10 09:19 AM

[QUOTE=RobTrew;114375]Various ways of doing that. If you are happy with the command line and simple shell scripts, you could fish the Python file out of the resources folder in the .scptd bundle, make a copy in your home directory, bypass Applescript altogether and use a command line like:

[CODE]python "$HOME/ofoc_sqlite_to_opml_005.py" "$HOME/Dropbox/CurrentTasks.opml" 1[/CODE]

(Or a final zero in lieu of 1 to suppress export of links).



Various requests are coming in for additional/alternative selections of data, I'll review them all and think about the options in a week or two.

[COLOR="White"]--[/COLOR][/QUOTE]

Fantastic, thank you.

RobTrew 2012-09-10 12:07 PM

-- ver 0.007 (above) restores the extraction of URLS from behind RTF links in OmniFocus notes

Thus notes stamped by my DevonThink/OmniFocus integration script, for example, will contain actual links to DevonThink records (or DevonThink to Go records on the iPad).

Something like:

[CODE]x-devonthink-item://D43AA941-020B-4BFD-A362-45B34A4D4713 [Devonthink oo3 notes][/CODE]

Rather than just the plain text label of the link:

[CODE][Devonthink oo3 notes][/CODE]

Splinky 2012-09-12 12:26 AM

I just want to commend this script to the group.

I just used it to create an excellent breakdown of where I am at with my various projects, for easy reporting to my manager.

Sure, it took a bit of fiddling to adjust the level expansion/contraction and jazz it up with some nice colours, but the end result was great.

If this OmniFocus/iThoughtsHD linkage could be enhanced within the programs themselves, this would be even better, but for now, this script is great.

mpw 2012-09-17 06:20 AM

As usual, a fantastic script from RobTrew! Thanks!!

How hard would it be to leave the tasks out of the OPML file so that it just shows the hierarchy of projects, folders etc.?

If I were to use this script for review purposes I wouldn't really be interested in seeing the actual tasks. Besides, I have so many tasks that folding the nodes takes a long time in a MindNode Pro mindmap.

RobTrew 2012-09-17 11:53 AM

[QUOTE=mpw;114623]How hard would it be to leave the tasks out of the OPML file so that it just shows the hierarchy of projects, folders etc.?[/QUOTE]

The fall is bringing, from various quarters, a rich harvest of requests for all kinds of variant data sets :-)

I'll need to take a look at parsing and applying additional/alternative SQL clauses so that that people can fine-tune for themselves. (On 'how hard', well, easy enough if you just want flat lists, but I'll need to give a little thought to the best way of doing it while preserving the branching hierarchy that one needs for visualisation).


All times are GMT -8. The time now is 01:49 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.