1Writer turns out to be an excellent companion for omniJS scripting of iOS OmniGraffle 3.
It's a good powerful text editor, and it also has a well-developed JavaScript interface, from which iOS OmniGraffle scripts can be constructed and launched.
Here is a rough draft of a 1Writer script which converts the active 1Writer (tab-indented) outline into a tree diagram in current OG3 test builds.
(NB OmniGraffle 3 is still in a test build stage - so a couple of glitches:
After the document i…

Essentially, in the Javascript interpreter of either of these apps, you

Define your JS code as a function with an argument,

convert the function to a string with the standard JS Function.toString() method and convert the argument to a string with the standard JSON.stringify())

Use encodeURIComponent() to URL-ify the function and the options/parameters that you are passing to it.