Skip to content

[MacOS] Executing AppleScript Script on Terminal

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


Read More

Leave a ReplyCancel reply

Exit mobile version