Chapter 4. Introducing the Language


Part I of this book describes AppleScript as a technologywhy and where and how you use it (Chapter 1 and Chapter 2), the Apple events that lie behind it, the AppleScript scripting component that implements it, the kinds of file it creates and some of the details of working with those files, and the means and modes whereby applications make themselves scriptable with it (Chapter 3). But AppleScript is also a language, a programming language that you'll want to learn and understand in order to create and edit AppleScript code on your own. Part II of this book teaches it to you.

This chapter serves as a starting point for your journey through the AppleScript language. The longest journey, it is said, begins with a single step. But even before that, sometimes it's a good idea to contemplate the road. That's what this chapter does. It describes the nature of the AppleScript language in very general terms. What sort of language is it? What is it like to learn and to use?

The AppleScript language deserves contemplation, and often gets it. AppleScript's users seem to spend as much time and energy venting their feelings about AppleScript as they do writing and editing AppleScript code. It's that kind of language. It frequently evokes an emotional reaction, and that emotion can range from frustration through exasperation to fury. Yet at the same time AppleScript has some surprisingly clever behaviors and abilities, and some remarkably sophisticated features.

I've never created a computer language, but I suspect it must be a special sort of labor, both satisfying and frustrating, a blend of artistry and engineering, calling for vision, philosophy, planning, determination, sweat, time, and sheer technological expertise. A computer is just a machine, but a computer language is a human creation. You might expect it to be dry, cold, and logical, but it isn't. Every computer language bears the stamp of its makers, and to learn a computer language is to experience, in some measure, the forces and ideas and goals that went into its creation. In short, AppleScript has a flavor. This chapter tries to describe that flavor.

(If you haven't read Appendix A, I would urge you to take a moment to do so right now. It displays, by actual example, what it's like to work with AppleScript, and shows why it's important to have a solid grounding in the language before trying to get any serious work done toward scripting a target application.)




AppleScript. The Definitive Guide
AppleScript: The Definitive Guide, 2nd Edition
ISBN: 0596102119
EAN: 2147483647
Year: 2006
Pages: 267
Authors: Matt Neuburg

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