Run an AppleScript from the command line

Apr 27, '01 02:24:52AM

Contributed by: Anonymous

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 quit

launch application "Dock"
3. Type Control-D when done.

You can also supply a filename to "osascript" to run the script inside, and you can compile—but not run—script files using "osacompile".

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20010427022452992