AppleScript Programming/Shell Programming

AppleScript can interact with UNIX shell scripts in a couple of ways. AppleScript can call UNIX shell scripts and utilities using the "do shell script" command. UNIX shell scripts can call the "osascript" utility to execute AppleScript code.

AppleScript command "do shell script"
To run shell commands from Applescript:

The user would hear a sound.

Shell command "osascript"
The osascript utility allows shell scripts to execute Applescript code in three different ways.
 * 1) Line by line from within a shell script using the
 * 2) Specify a plain text file or compiled script file using.
 * 3) Through the standard input.

For example, the following command in a shell script or at a prompt, will open a Mac OS X dialog box and wait for the user to respond:

The user would see: