The other day, I had a big outline on a wiki that I wanted to edit in OmniOutliner so I could hide and move things around with a real outliner, then export it back out to the wiki.
I managed to get it into OO with copy and paste and a lot of RSI-inducing tabbing, but the text export options can’t be massaged to export MediaWiki-style (eg, ‘#’ for level one, ‘##’ for level two).
So I wrote a quick Applescript to get the data out and get me back on my way. I thought I’d post it in case it would be useful to anyone else:
tell front document of application "OmniOutliner Professional"
set expText to ""
repeat with aRow in rows
set rowText to ""
-- start from 2 to treat top levels as headers
repeat with i from 2 to level of aRow
set rowText to rowText & "#"
end repeat
set rowText to rowText & " " & topic of aRow
set expText to expText & return & rowText
end repeat
set the clipboard to expText
display dialog "The exported text is in the clipboard."
end tell
Update: see the comments for a version for TWiki. Thanks, Peter!
6:42 pm January 30, 2007
Modified to do twiki!
tell front document of application “OmniOutliner Professional”
end tell
Michael — and Peter — thanks! This worked like a champ to pull dozens of user stories I did in OOP to Twiki. huge.
Hey Michael, this script was a godsend and works perfectly. Do you know if there’s a way to perform this the other way around? Copying the MediaWiki text into OmniOutliner and then do a find/replace turning the “#” characters into indents? Thanks so much! Mike
Michael, what I do is replace ‘#’ with tab in an editor - control-Q <tab> will insert a literal tab in the ‘replace’ text field, and you’ll get what you want. Then import that text into OO…
Hey Mike, thanks for the tip. What text editor are you using? I did what you said in TextEdit but when I copied the resulting text, each tab created a new column in OmniOutliner. I did get it working using Word, though. I just had to replace with “^t” which is the tab character for Word.
thanks, this script is helpful