As described in Introduction, Adobe Photoshop is the standard workhorse program for graphic designers on Mac OS X (and Windows, for that matter—but don't say that out loud). If you've never used Photoshop, you're missing out on a lot of power—and doubly so, because you're missing out on all the AppleScript control. By scripting Photoshop, you can color-correct images automatically, for example, or make your images look like surrealist paintings.
The scripts in this chapter require Photoshop CS (or later). If you don't feel like spending several hundred dollars for a new version of Photoshop, check out the fully functional 30-day demo, available at http://www.adobe.com/products/tryadobe/main.jsp#product=39.
Unlike the Finder, Photoshop doesn't support AppleScript recording (Section 18.104.22.168)—that is, you can't click the Record button in Script Editor and have AppleScript write out all the code for what you're doing in Photoshop. Fortunately, though, Photoshop supports recording of its own—you just have to click the appropriate button in Photoshop. And just as AppleScript sequences are called scripts, Photoshop's sequences are called actions.
Say you want to record a Photoshop action that corrects the color, levels, and contrast of an image, and then saves the file in a format suitable for a Web site. Here's the procedure for recording such an action:
Launch Photoshop CS (it's in your Applications → Adobe Photoshop CS folder).
If, contrary to ...