Chapter 1. Setting Up AppleScript


Although AppleScript is fast and free, perhaps the best part about it is that it gets installed right along with Mac OS X. You don't need to download any files, install any CDs, or configure any nasty system files to get AppleScript to work. In fact, you've got an AppleScript folder tucked inside your Applications folder, right this very moment.

Figure 1-1. The Applications AppleScript folder has everything you need to start writing your own scripts. Since you're going to be spending a lot of time here, it's a good idea to put this folder in your Dock.


If you don't have this folder, chances are you're not running Mac OS X Panther. See Section P.4.3.1 for instructions on how to upgrade to the latest version, Mac OS X Panther (version 10.3).

Whenever you install Mac OS Xor buy a new Macyou'll find these five icons in your AppleScript folder:

  • Example Scripts is simply an alias (shortcut) to your Library Scripts folder. This folder contains more than 100 example scripts for you to run, examine, and edit (Section 1.1.1).

  • Folder Actions Setup turns on the powerful folder actions feature of OS X. Once it's on, you can make the Finder run your very own scripts whenever you open a folder, add an icon to a folder, remove an icon from a folder, and so on. (A full explanation of Folder Actions appears on Chapter 11.)

  • Install Script Menu adds a new icon to the right side of your menu bar. With this menu in place, you can easily run your favorite AppleScripts from any program you want (read on for details).

  • Remove Script Menu hides the menu that appears when you double-click Install Script Menu.

  • Script Editor is AppleScript Central. From there you can open, edit, and run your scripts, and save them in any number of special formats. Script Editor coverage starts on Chapter 2.

Now that you know what you've got, it's best to spend some time getting acquainted with all the AppleScript stuff that's already on your Mac. Pop open a new Finder windowby choosing File New Finder Window, for exampleand then click the Applications folder icon in the Sidebar. Once in the Applications folder, open the AppleScript folder, and you're ready to explore.



AppleScript. The Missing Manual
AppleScript: The Missing Manual
ISBN: 0596008503
EAN: 2147483647
Year: 2003
Pages: 150

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net