Running Shell Scripts With AppleScript

While I was playing with AppleScript earlier this week I wanted to run a shell script I'd written from within Finder rather than from a shell prompt in Terminal.app.

On Windows I tend to write scripts to run under Cygwin and then write a wrapper batch file to run the script under the control of Cygwin's bash executable.

Turns out the AppleScript solution is identical in principal and is as simple as

do shell script "/full/path/to/shell/script"

You may need to adjust the path to the script dependent upon whether the directory where your script resides is in your $PATH or not.

Gary
Gary Gale

I'm Gary ... a Husband, Father, CTO at Kamma, geotechnologist, map geek, coffee addict, Sci-fi fan, UNIX and Mac user