OmniJS method to evaluate code and return value to JXA?

As I test the (really excellent) OmniJS, my workflow is to repeatedly copy-paste from a text editor to the Console, visually inspect the console message returned on evaluation, and make further edits in the text editor.

This works, but it does make me miss the document.evaluate({script: String, options:Dictionary}) method in TaskPaper’s use of a JS Context, which allows a JXA script to submit a JS script to the JS Context (equivalent of OmniJS), and get back any return values or error messages as programmatically available strings / data.

This not only helps a lot with workflow, while developing a script, it also allows for iterative interactions with a document, making use of JXA/osascript controls like Choose from List etc, to get a response from the JS context, and then send in a new request to update/change something.

Any chance of OmniJS acquiring something analogous ?

(This kind of JXA/Applescript link to OmniJS would also help with developing scripts, using macOS, for use on the iOS side)

1 Like

Interactive use of controls with an OG script:

This can be done from JXA, and it would be good to be able to do it with OmniJS too:

I’ve always meant for us to do this (we added a similar do script feature to OmniWeb’s scripting dictionary many moons ago), but hearing that someone other than me would find it useful is good feedback. I’ll make sure this is filed; thank you!