Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL



I think we owe my Aunt Sarah a big thank you. After all, she’s the one who inspired the book that’s about to change your computer life forever.

It was at one of those big get-togethers that occur frequently in ethnic families like mine. Hundreds of relatives gather, taking over the neighborhood and local markets to play, feast, and talk for days. Kids with parents and elders clustered around an ongoing buffet of Armenian goodness (my stomach still is full to this day), making the joyous racket that is life in motion.

Anyway, I wander into the kitchen, and there is Sarah, standing with her belly pressing against the edge of the sink, her dark hair pulled back into a bun of sorts, sleeves rolled up, elbows deep in a tub of dishes, with pile upon pile of plates on the counter next to her. Moved by her toil, I approach and offer to show her an easier way to clean the day’s plates, pans, and cups, to which she immediately quips “I don’t have time to learn how to use the dishwasher, I’m busy washing dishes.”

At some point in our lives, we’ve all felt like that. There’s no time to try something new, even if it can help us. We know what we know, learned on the job, and it works for us. It might not be the best or fastest way, but it’s what we know how to do. And so we labor harder and longer than we need to, missing any opportunity to make things easier for ourselves.

Until one day, something happens. Maybe you pick up a book. This book. And you decide you’re finally going to take a chance and spend a little time—just half an hour or so—to follow the first chapter, to see what’s possible and if it’s right for you. That’s when magic happens. The magic of AppleScript and its power to make the computer do what you want and need it to do for you.

It Was a Dark and Stormy Night ...

My name is Sal Soghoian, and since January 13, 1997, I’ve had the honor to be the product manager for automation technologies at Apple. To paraphrase a famous lawyer, “for me, AppleScript is a living breathing reality.” AppleScript been a big part of my life since a moment of inspiration in 1992: While working at a service bureau in Charlottesville, Virginia, I wrote my first script and changed the course of my life. It was this simple script for QuarkXPress:

set the color of the current box to "Blue"

And when the color of that selected text box changed from white to blue, I knew nothing would be the same. In an instant, the power to control the computer was no longer just in the hands of companies whose software I purchased: It was in mine as well.

By writing English-like statements, I could automate the many redundant tasks I performed over and over, all day long, at the service bureau. It was liberating! I quit my job, and for the next three months spent every waking hour teaching myself to master this wondrous technology. It took that long because there were no books, no videos, no podcasts, no Web sites to turn to for assistance—just a dedicated group of individuals in online communities who shared a passion to automate and accomplish the impossible.

How some things have changed for the better.

As time went on, my automation skills matured and grew (like most “scripters”) and people noticed, asking (and paying) me to write scripts for them. And for the next years, I wrote magazine articles, presented at trade shows, and taught individuals and classes how to take advantage of AppleScript and make it an essential part of their computer lives.

About This Book

This book is based on years of hands-on classes and contains many of the scripts developed for those sessions.

But the task of documenting and teaching a technology such as AppleScript is daunting (especially while you’re employed at a busy company like Apple), and it could not have been accomplished without the assistance and contribution of an exceptional individual with laser-like focus and deep knowledge of AppleScript: Bill Cheeseman. A lawyer of considerable renown, Bill leads a double-life as a talented programmer who has written extensively on the subject. He also is a master scripter and someone who I’ve learned from time and again. It was very fortunate that he made time in his schedule to contribute to this book.

For this book, Bill and I agreed that we were writing for those individuals without any programming or coding experience, just the same type of “normal folks” who take my classes at the Macworld Conference each year. People who work hard and are looking for an “easier way” to do things on the computer. They’ve heard about AppleScript and the promise that it holds but have never had the time or the means to learn it. And perhaps they looked at some of the excellent books on the subject but thought they were written for geeks and not for themselves. If you’re one of these “normal Mac users,” we designed this book for you (although scripters and programmers may find it useful too).

The book is divided into three sections (it is named AppleScript 1-2-3 after all), and is very step by step, hands-on, and easy to follow. You learn by writing short scripts that demonstrate principles, ideas, and techniques. Start with the first chapter, “The First Step,” in the first section, “Instant AppleScript,” and proceed in order through chapter 12. This first section teaches the basics and fundamentals to writing AppleScript. When you’re done with it, you’ll be a very dangerous person with a great foundation to build upon.

The remainder of the book, chapters 13 through 30, serve as a reference to specific AppleScript tasks and capabilities. Explore the subjects covered in those chapters as you need to. You’ll find they contain interesting topics such as manipulating image files, running scripts on a schedule, connecting to networks, and creating dynamic scriptable databases. There’s plenty to explore.

The third section of the book is not actually “in” the book: It’s on the book’s companion Web site, Here you’ll find updated information, downloadable examples and scripts, and other training materials.

Think Big. Start Small.

So let me close this forward with a word about believing in yourself: You can do this. You can learn how to automate the computer and the applications that run on it. Over the years, I have seen countless people—people just like you—spend a few hours, a few days, and even a few weeks, committing themselves to stretching and expanding their knowledge and skills, to grow, to learn, and in so doing, to change their computer lives forever. I’ve seen it happen. And I’ve seen their faces when the light goes on and they discover the power in their hands. It’s your turn now.

  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint