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 ...

Get Modding Mac OS X now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.