Here is a simple (no-frills) example of deriving a textual outline (tab-indented text) from an OmniOutliner outline, using the ‘omniJS’ or ‘Omni Automation’ JSContext included in current builds of OO 5.3 Pro.

Works with: OO 5.3 test (v189.2 r305308)

To test on macOS

Copy the whole of the source code, and paste it into Script Editor,

check that the Script Editor language selector (top left) is set to JavaScript

check that an outline is open in OO, and run.

The tab-indented version will be placed in the clipboard, and displayed in Script Editor.