View Single Post
FoldingText is a very quick and fluid outliner (in the Markdown idiom, with a powerful XPath-modelled filtering engine beneath the hood, and a scripting interface to use it with).

I find it an unusually good environment in which to think and write, and in which to quickly outline and reorganise a project before committing it to OmniFocus.

Here is an early draft of a script which exports a sub-tree from FoldingText to OmniFocus, avoiding any duplication, and reporting (through Growl or an Applescript dialog) on the existing matches which it has found, and on any new Folders, Projects and Tasks which it has created in OmniFocus.

Usage:
  • In FoldingText, place your cursor in the first line (the top level line) of the outline which you wish to export to OmniFocus,
  • run this script,
  • and exercise a little patience creating tasks through Applescript works well, but can never be fast.
  • In a while, a report will appear

Approach:
Which levels of the FoldingText outline will be treated as folders, and which as projects and tasks ?

The first line in the outline which ends with FoldingText's special .todo tag will be interpreted as a project. Any ancestors of this line will become nested folders in OmniFocus, and any descendants will become nested tasks.

Outlines which contain no .todo tag will be interpreted as projects - the top level line will be exported as a project, and its descendants as nested tasks.

Non-duplication. The script checks to see whether the outline, or part of it, is already in OmniFocus. If it finds any existing matches, it will add any new material, but will not duplicate. The report at the end gives counts of objects found and created.
Note:
For reasons internal to the OmniFocus Applescript interface, when the script is updating an existing set of nested tasks in OmniFocus, any existing task which gets new children will initially be collapsed rather than expanded in the GUI, so you may not immediately notice the new additions :-)
Feedback:
Very much a first draft, so test it cautiously with toy data, until you get a sense of how it works. Bug reports and suggestions welcome.
Update:
  • I have updated this script to a version which also offers exports to OmniOutliner or OmniGraffle, so it now starts with a menu of three export targets.
  • Anyone who prefers to disable the menu and make three separate copies (giving each, for example, a different key assignment in Keyboard Maestro) can first edit pblnMenu, near the top of the script, to false, and then set plngTarget to one of the three appropriate values. (See below).

Code:
property plngOFOC : 0 -- OmniFocus
property plngOOut : 1 -- OmniOutliner
property plngOGfl : 2 -- OmniGraffle

property pblnMenu : true -- IF FALSE, SKIPS MENU AND EXPORTS TO APP indicated by plngTarget (below)
property plngTarget : plngOOut
The current version is in a Github repository.

--

Last edited by RobTrew; 2012-12-25 at 02:49 PM.. Reason: Ver 018 - Link to Github version