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.
Using the "do shell script" commandEdit
To run shell commands from Applescript:
do shell script "afplay /System/Library/Sounds/Glass.aiff"
The user would hear a sound.
The osascript utility allows shell scripts to execute Applescript code. 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:
osascript -e 'tell app "System Events" to activate' -e 'tell app "System Events" to display dialog "Hello, world!"'
The user would see: