View Single Post
The export command for OmniOutliner is a little weird. "OORTFPboardType" is the string you have to feed it to export as RTF. I'm sure it's documented somewhere, but I only found it by doing:

Code:
tell application "OmniOutliner Professional" to return writable document types
If you ever decide you want to use plain text again, the three plain-text exporters are:
"NSStringPboardType" - Columns separated by tabs,
"OONeatoStringPboardType" - Fixed-width columns,
"OOMORETextDocumentType" - MORE 3.1-style.

Be sure to change the extension in the script if you're going to switch to plain text. Maybe I'll get around to updating the script to switch between them.)

The trouble with the formatting lost is that when you create a new document from AppleScript, OmniOutliner ignores your default template and uses the apparently hard-coded one it defaults to when first installed. Only styles that are part of the individual rows get copied, everything else comes with the template.

The best solution I can see is to just open a template instead of creating a new temporary document. Unless you're using a lot of differently-styled documents, this should be fine. All of the inline styles will still be copied as they are now.

Place this (or an alias to whatever other template) at the top of the script.
Code:
set template to alias ((path to application support from user domain as string) & "OmniOutliner 3:Templates:Default.oo3template:")
Then, replace "set newOutline to make new document" with:
Code:
open template
set newOutline to front document