In order for you to run an Applescript from the shell, just type in:
osascript script name
If you look at the manual for osascript you can see that it also hosts a variety of other scripting languages and is very useful for many jobs outside of Mac OS.
Just a quick tip! ;)