I started with a simple “Hello, world!”-ish program in the Script Editor.
I saved the program. I noted that the suffix on the filename is “.scpt” instead of “.js”
I then tried to run the script, jstest.scpt via the “osascript” command:
I tried to add the language-specifier option to the command-line. That didn’t seem to make a difference:
I wondered what would happen if I exported the script as an application from the Script Editor. I tried that next:
Once saved, I used the “open” command to invoke jstest.app:
To run from the command-line without exporting, I wrote a short bash script that will invoke the scpt file, but will redirect stderr to /dev/null ( which can be dangerous if some exception condition happens in the script. )