A year ago today I was working on understanding OPML and writing scripting solutions around it. I never did get OmniOutliner2OPML working correctly, and Omni released a new version of OmniOutliner that supported OPML directly.
As an AppleScript, though, OmniOutliner2OPML was interesting enough to form the basis of an article over at Studio Log by Jesse Shanks called “OmniOutliner as a Script Analysis and Management Tool” so it wasn’t totally wasted effort.
The script, like any programming that handles outlines, binary trees, and other branching data sets, contains recursive logic that has to process each level of the tree repeatedly. I used to obsess over this sort of stuff for hours in my old day job, writing selective disclosure tree controls for browsing document relationships in workflow applications and trying to make them as lightweight as possible. Because the reality is that tree structures are both easy and gnarly to program—easy, because they are highly repetitive in their structure (does this node have children? if so, ask each of them if they have children, and so forth), and hard because it’s hard to predict how deep the tree will go and how many levels you’ll have to process, and how long it will take.