Last Updated on 2022-07-22 by Clay
We can execute the AppleScript script file on Mac OS default terminal. In additional to this method, the easiest way to test it to use the system default Script Editor.
But it is not a common usage to always execute the script in the editor. Today I will record how to run the AppleScript program we wrote in the terminal.
Execution
Method 1: Use osascript command to execute script file
osascript <YOUR_APPLESCRIPT_FILE>
Method 2: Use oasscript command to execute the scripting langauge
osascript -e 'display dialog "Hello World"'
Output:
References
- https://osxdaily.com/2016/08/19/run-applescript-command-line-macos-osascript/
- https://alvinalexander.com/blog/post/mac-os-x/running-applescript-from-unix/