Hardware Reference
In-Depth Information
Figure 36: Here's your first complete AppleScript!
4. Click the green Run button.
Two things should happen. First, you'll hear your system alert sound. That was your program
running—congratulations! Second, you'll notice that the word beep changed its appearance
from a purple, monospaced font to a bold, blue, proportional font. That's because when you
try to run an AppleScript, the script editor first compiles it, a process that checks to make
sure it's properly written. If it is, it formats the entire script in an easier-to-read fashion
(which will be more apparent with a longer script).
Now that you've written and run an AppleScript, you can follow the same steps to run scripts
other people have written—simply type (or copy and paste) the scripts into AppleScript
Editor and click the Run button. We'll come back to this idea in a bit, but for now, I merely
want to point out that using AppleScript can be as simple as that.
Learn What AppleScript Can Do
The simplest way to think about what AppleScript can do is that it provides an alternative
means of performing common actions in OS X and in many apps. For example, you can open
or quit an app using menu commands or the keyboard; AppleScript can also open or quit
apps as part of a script. You can rename a file in the Finder; an AppleScript can do that too.
You can open a word processor, do a search for a certain word, highlight the entire paragraph
Search WWH ::




Custom Search