Terminal Icon

Running shell or UNIX commands from an AppleScript

AppleScript is a powerful English-like scripting language that is part of Mac OS X. You can use AppleScript scripts to run UNIX or shell script commands. AppleScript can send commands to Terminal by using the “do shell script” command.

To run a UNIX or shell command from an AppleScript script:

Use the following command in your AppleScript script:

do shell script < the command >

In this example “the command” is the command or shell script to execute. (For example: “ls” or “/bin/ps -auxwww.”)

For more information on the do shell script command, see AppleScript Help or the AppleScript website.


Related Topics

UNIX

AppleScript

Open

AppleScript website