Two completely different programming interfaces, and two quite different JavaScript interpreter instances. One system-wide (osascript), one embedded in the Omni app itself.
The shell can only access the JavaScript for Automation interface, the objects of which are shared by the AppleScript interface (two different language options for osascript
).
The console in Omni apps gives access to a completely different instance of a JavaScript interpreter (private to the particular app, unlike the system-wide osascript -l JavaScript instance) and a completely different programming interface, with different objects, methods and properties.
Current development focuses entirely on the JSContext
to which the console (and Omni Automation plugins) give access.
The old osascript interface is quite different, and in legacy / sunset mode.
(Because it uses a JSContext external to the application, it also has more interface traffic overheads, and executes more slowly)