O'Reilly logo

AppleScript: The Missing Manual by Adam Goldstein

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

Controlling Photoshop

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.

Note

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.

Recording Actions

Unlike the Finder, Photoshop doesn't support AppleScript recording (Section 2.1.1.1)—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:

  1. Launch Photoshop CS (it's in your Applications Adobe Photoshop CS folder).

    If, contrary to ...

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