Hardware Reference
In-Depth Information
AppleScript has been around since way back in 1992, and it's become popular among people
who like to tinker but wouldn't consider themselves programmers, because it's built into
OS X and is a lot easier to work with than a big, complicated language like Objective-C.
AppleScript is often referred to as “English-like,” which is a generous description at best,
but if you don't know much about programming, you can probably make more sense of
AppleScript code than, say, Java.
Coming in Yosemite: With OS X 10.10, you'll be able to choose either AppleScript or
JavaScript when writing scripts. That'll make scripting easier for people who already
know JavaScript. Perhaps one day, you'll be able to do the same with Apple's new
Swift language.
Write a Simple AppleScript
In a moment, I'll give you some examples of what you can do with AppleScript (see Learn
What AppleScript Can Do ). But first—before I lose the attention of people who think
programming is Just Too Scary—I'm going to show you how to write a complete AppleScript
program with exactly one English word. Here we go:
1. Open AppleScript Editor (in /Applications/Utilities ).
Coming in Yosemite: AppleScript Editor will be renamed Script Editor,
since it'll support more than just AppleScript.
2. In the window that appears, click New Document. A blank window opens.
3. Type the word beep ( Figure 36 ). Your script is now complete!
Search WWH ::




Custom Search