Which kind of javascript env does Automation run?


(Choosing OmniPlan - OmniPlan for Mac for lack of a better selectable category).

Hi there.
I’m very interested in Automation for OmniPlan. I would like to know more about which kind of javascript enviroment our scripts get executed on. Is it a embedded nodejs? Which version?

Ultimately I’m trying to understand what can I do inside my scripts:

  1. Which javascript syntax can i use?
  2. If a superset of a nodejs version, can I import modules (for example, fs, so I can read local files in the filesystem; or https to make http requests)?
  3. Can I import npm modules somehow (external libraries)?



No, not nodejs.

It’s a JSContext object:


No NodeJS access to the filesystem, and no DOM.

You can list the set of available top-level objects by evaluating


in the Automation Console.

To narrow that down to the file API objects:

Object.keys(this).filter(s => s.includes('File'))

Which will yield:

[FileSaver, FileWrapper, FileType, FilePicker]

(details for each of which can be found in Automation > API Reference)


PS you will also see a URL object with a fetch method.

See, for example: https://omni-automation.com/shared/url.html