JXA vs OmniJS application version strings

A small thing, but in testing the omniJS API for OmniOutliner etc it can be helpful to know which build we are dealing with, before submitting code to the omniJS (‘Omni Automation’) JSContext.

At the moment:

  • omniJS :: app.version gives us a detailed version / build string, whereas
  • JavaScript for Automation: :: Application.version() gives only a broader brush.

If anyone has time, might it be possible to align them, enriching the value returned by the JXA version ?

Sample code and contrasting results:

(() => {

    // OMNIJS ('OMNI AUTOMATION') OO JSContext
    const omniJSContext = () =>
        app.version;

    // JavaScript for Automation (JXA) JS Context
    const
        oo = Application('OmniOutliner'),
        strVer = oo.version();

    return JSON.stringify({
        JXA: strVer,
        omniJS: oo.evaluateJavascript(
            '(' + omniJSContext + ')()'
        )
    }, null, 2);
})();
--> {
  "JXA": "5.3 test",
  "omniJS": "189.2.0.304855"
}