Passing user input from JXA to OmniJS

Atomic arguments can, of course, be stringified, with .toString() or just concatenation,
but things get easier if we pass a JSON.stringified version of a single argument (a dictionary of key-value pairs),

So while stage one might be as simple as:

(() => {
    'use strict';

    const og = Application('OmniGraffle');

    const ogJSContext = options => {
        return options.toString();
    };

    return og.evaluateJavascript(
        '(' + ogJSContext + ')(' + 7 + ')'
    );

})();

For most purposes it works better to write things like:

(() => {
    'use strict';

    const og = Application('OmniGraffle');

    const ogJSContext = options => {
        return JSON.stringify(options.color) + '\n' +
        options.deviceName;
    };

    return og.evaluateJavascript(
        '(' + ogJSContext + ')(' + JSON.stringify({
            color: [0, 0, 1],
            deviceName : 'BlueBottle'
        }) + ')'
    );

})();