Want to run an AppleScript command real quick from Terminal? It's easy!
1. Run "osascript".
2. Type your script, for example:
tell application "Dock" to quit3. Type Control-D when done.
launch application "Dock"
Mac OS X Hints
http://hints.macworld.com/article.php?story=20010427022452992