O'Reilly logo

Mac OS X: The Missing Manual, Second Edition by David Pogue

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing Your Own AppleScripts

If you ask a crowd of Mac users how many of them write AppleScripts, few hands are likely to go up. That’s too bad, because as programming languages go, AppleScript is easy to understand. It takes only a few weeks, not years, to become comfortable with AppleScript. And the power AppleScript places in your hands is well worth the effort you’ll expend learning it.

For example, here’s a fragment of actual AppleScript code:

open folder "AppleScript" of folder "Applications" of startup disk

You probably don’t need a manual to tell you what this line from an AppleScript program does. It opens the ApplicationsAppleScript folder on your hard drive. (That’s the folder that contains Script Editor, the Mac OS X program that lets you write your own AppleScripts, and Script Menu.menu, described in Section 7.1.)

If you have no interest in learning to program, you’re forgiven; you’re not alone. But almost every Mac user can benefit by understanding what AppleScript can do, why it’s important in certain industries, and how it may be useful in special situations. Even skimming this section will give you an appreciation of AppleScript’s power—and yet another reason to relish being a Mac user: Windows has no equivalent of AppleScript. And with AppleScript’s ability to tie into Terminal to run Unix commands, the power available to you has become even greater.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required