O'Reilly logo

Modding Mac OS X by Erica Sadun

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

Chapter 9. Basic Application Scripting

Basic Application Scripting

Bill of Materials

Mac OS X Software

  • Script Editor (/Applications/AppleScript)

  • System Preferences (/Applications)

  • Terminal (/Applications/Utilities)

  • Calculator (/Applications)

  • TextEdit (/Applications)

  • Address Book (/Applications)

  • iDVD 4 (/Applications; part of iLife ‘o4)

  • Apple’s UI Element Inspector (http://www.apple.com/applescript/uiscripting)

  • iChat (/Applications)

  • Safari (/Applications)

Third-Party Software

Application scripting provides, at once, both the most empowering and the most frustrating of challenges available to any application modder. Applying AppleScript to an application isn’t entirely like other programming work. It’s not enough to conceptualize the task you want to do and then lay out the actions that perform that task. There aren’t sets of basic objects and operations that work consistently time after time. And to make matters worse, a command that works with one application may not work with another.

Instead, you must wiggle into the application developer’s mindset and discover how application-scripting hooks were added to the program. You need to use those hooks to open up an application’s world of possibility. That means you’ll have to spend a good deal of time applying a trial-and-error approach to deconstructing the application’s scripting interface. The rewards, however, are ...

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