AppleScript Icon

Running shell or UNIX commands from an AppleScript

You can use AppleScripts to run UNIX or shell script commands. AppleScript can send commands to Terminal by using the Do Script command.

To send a UNIX or shell command from an AppleScript:

Enter: do shell script- command
Where "command" is the command or shell script to execute. (For example: "ls" or "/bin/ps -auxwww".)

You can also run AppleScripts from Terminal using the osascript command. To do so, enter:

osascript scriptname

Where "scriptname" is the name of the AppleScript you want to run.

For more information of the Do Script command, see AppleScript Help.

See also

UNIX

AppleScript