Writing actions for batch-processing raw images is relatively simple. You don't need to worry about making sure that the action can operate on files that already have layers or alpha channels, or that are in a color space other than RGB. You're always dealing with a known quantity. Bear in mind that if your actions call other actions, the other actions must be loaded in Photoshop's Actions palette, or the calling action will fail when it can't find the action being called. An easy way to handle this is to make sure that any actions on which other actions are dependent are saved in the same set as the actions that depend on them. Simple ActionSave as JPEGLet's begin with a simple action that opens a raw image at its native resolution and saves it as a maximum-quality JPEG in the sRGB color space. Creating an action and action setStart out by creating a new action set called "Batch Processing" in which to save the actions you'll create in the rest of this section (see Figure 11-79 and "Actions, Automate, and Scripting," in Chapter 12, Essential Image Techniques.) Figure 11-79. Creating an action setCreating a new actionBefore creating the action, select a raw image in Bridge that has already had custom Camera Raw settings applied. That way, once you've created the action, you can start recording immediately without recording any extraneous steps, such as selecting a file, and you can correctly record the Camera Raw Selected Image setting. Now click the "Create new action" icon in Photoshop's Actions palette, enter a name (such as "Save as JPEG") for the action, and then click Record to dismiss the dialog and start recording the action. Recording the Open stepNow that you're recording, switch back to Bridge and open the image in Camera Raw by pressing Command-O (you must open the image in Camera Raw hosted by Photoshop). The Camera Raw dialog box appears (see Figure 11-80). Figure 11-80. Recording the Open stepWhen you use the action in Batch, the Camera Raw dialog box won't appear, so it's essential to get the settings right when you record this step. You need to record several key settings for this action in the Camera Raw dialog box.
Then click OK to open the image. (If the Profile Mismatch warning appears, click OK to dismiss it. This doesn't get recorded in the action, and anyway, you'll suppress the warning when you use the action in Batch.) The image opens, and the Open step appears on the Actions palette. Recording the Save stepTo record the Save step, choose Save As from the File menu, or press Command-Shift-S. The Save As dialog box appears. The filename and the destination for saving that you enter here has no impact on the batch processwe tend to use an obviously silly name such as "foo.jpg"and choose the Desktop as destination, to simplify cleanup. In this example, make sure that the format is set to JPEG, and incorporate any other settings in this dialog box that you want to include in the action. Then click Save to proceed to the JPEG Options dialog box, set the desired quality, set the Format Options to Baseline (Standard) for maximum compatibility with JPEG-reading software, and then click OK. The file is saved on the Desktop as "foo.jpg," and the Save step appears in the Actions palette. Then close the open document so that a Close step appears in the Actions palette. Stop and saveFinally, click the Stop button in the Actions palette to stop recording. Photoshop doesn't allow you to save individual actions to diskonly action sets. So if you want to save an action as soon as you've written it, you need to select the action set that contains it in the Actions palette and then choose Save Actions from the Actions palette flyout menu (see Figure 11-81). Figure 11-81. Saving the action set
Tip: Go Ahead and Save Now Note that until you save actions explicitly using the Save Actions command, they exist only in Photoshop's Preferences, and Photoshop's Preferences only get updated when you quit the application "normally" by using the Quit command. If Photoshop crashes, or you suffer a power outage, any unsaved actions will be lost. So if your actions are even slightly complex, it's a very good idea to save them before doing anything else. You can save actions anywhere, but if you want them to appear automatically in the Actions palette even after deleting Photoshop's preferences, save them in the Adobe Photoshop CS2/Presets/Photoshop Actions folder. When you expand the steps in the Actions palette by clicking the triangles beside those that have them, you can see exactly what has been recorded for each step (see Figure 11-82). When you use this action in Batch with the appropriate overrides selected (see "Rules for Batch Processing," earlier in this chapter) the filenames and folder locations you recorded will be overridden by the settings in the Batch dialog box, and all the other settings you've recorded herethe Camera Raw workflow settings and the JPEG Save Optionswill be honored. Figure 11-82. Save as JPEG action
VariantsYou can create variants of this action by recording different Open or Save steps. For example, you can create larger JPEGs by changing the Size setting in the Camera Raw dialog box to one of the larger sizes, and you can embed thumbnails or create lower-quality JPEGs by making those settings in the Save As and JPEG Options dialog boxes, respectively. To save in a different format, with different options, just choose the desired format and options when you record the Save step. Complex ActionSave for EditNow let's try a more complex example: an action that produces 16-bit/channel TIFFs with adjustment layers set up ready for final editing in Photoshop. It's designed for use on "hero" images that merit individual manual edits in Photoshop. It doesn't actually do any of the editing, because the required edits will almost certainly be different for each image in a batch. Instead, it simply does a lot of the repetitive grunt work involved in setting up an image for editing, so that when you open the image, all the necessary adjustment layers are already there, waiting for you to tweak them. (Or, if you don't need them, you can throw them away later.) Create the new actionYou can record this action in the same set as the previous one, since it's also designed for raw processing. As before, select a raw image in Bridge that has had custom Camera Raw settings applied before you start recording the new action. Then click the "Create new action" icon in the Actions palette, enter a name (such as "Save for Edit") in the New Action dialog box, and then click Record to start recording. Recording the Open stepAs before, start by launching Camera Raw from Bridge by pressing Command-O. In the Camera Raw dialog box, again make sure that Settings is set to Selected Image. This time, though, you'll make some different workflow settings.
Then click OK to open the image. The image opens, and the Open step appears on the Actions palette. Adding the editsThis action adds three different editing layers to the image before saving and closing; a Levels adjustment layer; a Curves adjustment layer; and a Hue/Saturation adjustment layer, as follows.
Recording the Save stepAs before, choose Save As from the File menu, naming the file "foo" and save it on the Desktop for easy disposal after you're finished making the action. This time, choose TIFF as the format, make sure that the Layers and Embed Color Profile checkboxes are turned on (creating untagged ProPhoto RGB files is a Very Bad Idea). Then click Save to advance to the TIFF Options dialog box, and make your preferred settings. (Again, see Chapter 13, Image Storage and Output, for advice.) Finally, close the image (so that the batch operation will do so, too), and click the Stop button in the Actions palette to stop recording. Figure 11-83 shows the resulting action in the Actions palette with all the steps expanded. Figure 11-83. Save for Edit action
As with the earlier, simpler action, when you use this action in a batch process with the necessary overrides applied in the Batch dialog box, the filenames and locations will be overridden by the Batch settings, while everything else in the Open and Save steps will be honored. |