This is one of the most important tutorials in this book. I know this is a bold statement but after you learn how to do this, you'll unlock a ton of mystery that surrounds actions. The first time I recorded an action to add a watermark to my photos, I was extremely disappointed with the results. You see, some of the photos were portrait oriented and some were landscape. Basically, I had a lot of different image sizes and dimensions, but I wanted one action to add a watermark to all of them.
The Problem with Specific Image Coordinates in Actions
When you record an action that places, say, a watermark in the center of an image, the action actually records the exact coordinates in which you place that watermark. This is fine if you always play the action on images that are all the same exact size and orientation as the one in which you recorded the action. Since this isn't always the case, this issue presents our action with a problem in a big way, especially if the symbol is created in an area of the image that doesn't exist in other images. Here's the trick: You first need to place your watermark in the image in a way that Photoshop will recognize it no matter what type of image you're working with. Next, you need to use Photoshop's automatic alignment features to center the watermark so that no matter what the final dimensions of your image are, it'll still be in the center. Let's take a look at how we can do this.
Open a photo to which you'd like to add a watermark. First, let's insert the watermark shape. Don't worry, though, we don't have to start recording yet. In this example, I'm using a custom shape that comes with Photoshop CS2. It's the copyright symbol. Select the Custom Shape tool (press Shift-U until you get it), then in the Options Bar, click the Shape thumbnail, and from the resulting Custom Shape Picker, click the copyright symbol.
Next, in the Options Bar, click Paths (it's the third icon from the left and looks like a square with the Pen tool icon in it). This tells Photoshop that you want to create the custom shape using a path only and not a shape layer or pixels.
Now, press-and-hold the Shift key (this makes sure the proportions stay correct) and draw a copyright symbol anywhere on the image.
As I mentioned in the opening, depending on the size and orientation of your image, the exact coordinates of where you placed this copyright symbol may or may not exist in the image that you run this action on. To get around this we're going to use a little trick. First, press Command-T (PC: Control-T) to go into Free Transform mode. Then in the Options Bar, on the Reference Point Location icon, click on the top left white square. Finally, set the X and Y coordinates to 0. This will place the logo in the top-left corner of the image.
Okay, now you're ready to actually start recording the action. In the Actions palette, click the Create New Action icon at the bottom right of the palette. Name the action "Add Watermark" and click Record to start recording the action.
In Step Three, you created the copyright symbol. Let's insert this symbol into the action now as a path, so you never actually have to have that custom shape loaded on the computer. Go over to the Paths palette. Unless you've changed your palette layout, it should be nested beneath the Layers palette.
From the Toolbox, select the Path Selection tool (A). Then click once on the copyright symbol to select the path. Now, you should see all of the anchor points that make up the path.
From the Actions palette's flyout menu, choose Insert Path. This actually records the entire path itself into the action. No custom shapes are added, so anyone can use this action.
Now, we need to turn this path into pixels. In the Paths palette, Command-click (PC: Control-click) on the Work Path thumbnail. This will turn the path into a selection.
Go back over to the Layers palette. Create a new layer by clicking on the Create a New Layer icon at the bottom right of the palette. Press D to set your Foreground color to black. Finally, press Option-Delete (PC: Alt-Backspace) to fill the selection with black. Press Command-D (PC: Control-D) to Deselect.
Next, to place the logo in the exact center of the document press Command-A (PC: Control-A) to Select All. Choose Layer>Align Layers To Selection>Vertical Centers. Then choose Layer>Align Layers To Selection>Horizontal Centers. This will put the watermark in the exact center of the image no matter what the image dimensions are. Press Command-D (PC: Control-D) to Deselect.
Now, it's time to add the watermark style. Double-click on the copyright layer to bring up the Layer Style dialog, click on Bevel and Emboss along the left side of the dialog to turn on the checkbox. You can leave the default settings, or if you're the type that always needs to tweak things (hey, you know who you are), then feel free to adjust the settings here. Don't click OK yet.
Next, click on Blending Options (at the top left of the dialog), and in the Advanced Blending section, drop the Fill Opacity setting down to 0%. This should remove all of the color from the watermark but leave the beveled see-through appearance intact. Now, click OK.
To wrap things up, go to the Paths palette and drag the Work Path to the Trash icon to delete it. We don't need it anymore and there's no reason to save it. Then in the Layers palette, choose Flatten Image from the palette's flyout menu, to flatten all layers.
Press Stop Recording and you're done. Whew! That was a long one but worth it. Now you can open any image (any size or orientation) and run this action on it. You can give the action to someone else who doesn't even have that copyright custom shape loaded and they can run it, too. Better yet, use your own watermark in Step Three (which other computers are not likely to have) and you'll really start to see the power of inserting a path into an action.