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

Chapter 9. Basic Application Scripting

Chapter 9. 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 many. Once you figure out how the scripting works, you can truly make any Mac OS X application roll over, sit up, and beg. Until then, you're in for a slog that can test the patience of the most relaxed and laid-back of geeks, so prepare to strap on that beanie with the propeller on top.

Fortunately, there are techniques that, when followed precisely, can reveal the working scripting technologies for most applications and provide a way to control them. These techniques are rather blunt instruments. They require patience and a stubborn doggedness in their application, but they do work time after time.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint