22. Actions

Image

To automate repetitive (and boring) editing tasks, you can record a sequence of commands in an action and, at any time, replay the action on one image or on a batch of images. Actions can be used to execute anything from a simple edit, such as converting files to a different format or color mode, to a complex sequence of commands, such as applying a series of adjustments or filters, or a sequence of preflight steps to prepare your files for output. With actions, you can boost your productivity, relieve your life of (some) drudgery, and standardize your editing steps. You can use any of the ready-made actions that are included with Photoshop, or create your own custom actions for various tasks. In this chapter, you’ll learn how to record, play, and edit custom actions, and how to save and load action sets (collections of actions).

Recording an action

Using the Actions panel, Image you can record, store, edit, play, delete, save, and load actions. The panel has two modes: List (edit) A and Button (A, page 429). When the panel is in List mode, you can expand or collapse the list of commands in an action; toggle a dialog control on or off; add, exclude, delete, rerecord, or change the order of commands; or save actions and action sets to an actions file. To put the panel into List mode, uncheck Button Mode on the panel menu.

Image

A This Actions panel is in List mode.

Each command that is recorded in an action is nested below the action name on the Actions panel. Actions, in turn, are stored in sets. Note: To include edits in an action that aren’t directly recordable, see pages 433434.

To record an action:

1. The action you’re about to record has to be stored in a set. To create a set, click the New Set button Image at the bottom of the Actions panel, Image type a descriptive Name, then click OK.

2. Open a document or create a new one. We recommend copying the document using File > Save As.

3. Click the New Action button Image at the bottom of the Actions panel.

4. In the New Action dialog, enter a Name for the action, and from the Set menu, choose a set (either the one you created in step 1 or a different one).A

Image

A Use the New Action dialog to assign a name and set to your action, as well as an optional shortcut and/or color, then begin recording.

5. Optional: Choose a shortcut for the action from the Function Key menu, and check Shift and/or Command to prevent conflicts with the function keys that are assigned to system commands. Choose a color to display behind the action name when the panel is in Button mode.

6. Click Record.

7. We recommend as a first edit that you create a snapshot of the current state of the document on the History panel. Next, execute the commands that you want to record, as you would normally apply them to any image. Any time you enter values in a dialog and click OK, your settings will be recorded (unless you click Cancel).

8. When you’re done recording edits for the action, click the Stop Playing/Recording button. Image

9. The new action listing appears on the panel. Note: To save your action sets to a file (recommended), see page 438.

Image If you create layers or alpha channels while recording an action, assign them descriptive, nongeneric names to prevent the wrong layer or channel from being edited when the action is played.

Image When recording the Save As command in an action, don’t change the file name. To preserve the original file, either choose a different folder location or add a modal control to the action to make it pause at the Save As command to allow for user input (see page 435).

Image To open the Action Options dialog for an action (e.g., to change the shortcut), double-click its listing.

Playing an action

An action can be triggered in various ways: via the Play button on the Actions panel; via a keyboard shortcut that was assigned to it; by dragging a file or folder full of files onto a droplet icon that was made from the action; or by using the Batch feature. We’ll begin with the Play button and shortcuts.

To play a whole action on one image:

1. Open an image and create or click an image layer.

2. Optional: If the action to be played doesn’t include creation of a snapshot as an initial step, use the History panel to create one now, to preserve the option to restore the image to its pre-action state.

3. Do one of the following:

If the Actions panel is in List mode, click an action name, then click the Play button. Image

If the panel is in Button mode, click the button for the action to be played.A

Image

A When the Actions panel is in Button mode, each action is listed as a colored button. Assigned shortcuts, if any, are also listed.

Execute the keyboard shortcut, if one has been assigned to the desired action.

Image To load more action set libraries onto the panel, see page 438.

To exclude a command from playback:

1. Put the Actions panel in List mode (actions can’t be edited in Button mode).

2. Expand the list for the action to be edited.

3. Click in the leftmost column for the command that you want to exclude from playback, to remove the check mark.B The check mark for the main action listing turns red. (To reinclude the command, click in the same column again.)

Image

B To exclude a color change in our “brush shape” action from playback temporarily, we unchecked that step.

Note: If you click the check mark for an action, as an alert may inform you, Photoshop will uncheck or recheck all the commands in the action.

To play a partial action:

1. Put the Actions panel in List mode.

2. If necessary, click the arrowhead next to an action name to expand its list of commands.

3. Do either of the following:

To play the action from a command onward, click the command name, then click the Play button. Image

To play just one command in an action, click the command name, then Ctrl-click/Cmd-click the Play button (or simply Ctrl-double-click/Cmd-double-click the command).

The ability to play an action on multiple files is a great timesaver. This can be done quickly by dragging a folder of files onto a droplet (see “To create a droplet for an action,” on page 432). Or if you need to choose a destination, a file-naming scheme, and other options for the files to be processed by the action, use the Batch command instead, as described on this page.

To play an action on a batch of images:

1. In Bridge, put all the files to be processed into one folder and display the folder contents (or to limit which images are processed, select those thumbnails), then choose Tools > Photoshop > Batch.

2. The Batch dialog opens (A). Under Play, choose an action set from the Set menu and an action from the Action menu.

Image

A In the Batch dialog, choose an Action to be played, choose Bridge as the source, specify a Destination for the processed files, and choose optional File Naming settings.

3. For the Source, choose Bridge.

4. Optional: If the action contains an Open command, check Override Action “Open” Commands to have the batch command ignore the specific file name that was chosen when the Open step was recorded.

5. Check Suppress File Open Options Dialogs and/or Suppress Color Profile Warnings to prevent those dialogs or alerts from appearing onscreen (and pausing the playback) as source files are opened.

6. Optional: By default, Photoshop will stop the Batch process if it encounters an error. To have it play the whole action and keep track of error messages in a text file instead, from the Errors menu, choose Log Errors to File, then click Save As. In the Save dialog, type a name for the text file (keep the extension), choose a location for it, then click Save. If errors are encountered, after the batch processing is finished, you will be alerted via a prompt that errors were logged into the designated error log file.

7. From the Destination menu, choose one of the following options:

None to keep all the files open after processing.

Save and Close to have the files save after processing and then close.

Folder to have the files save to a new folder and to make the File Naming options for naming the resulting files accessible (the naming options prevent the new files from replacing the original ones). Click Browse/Choose, choose a destination folder, then click OK/Choose.

Optional: If you check the Override Action “Save As” Commands option, the Batch command will ignore any Save As command that was recorded into the action and execute the Destination option that you have chosen instead.

8. If you chose Folder as the Destination, under File Naming, you can do the following:

Type text to be included in the name in one or more fields on the left, or choose a file-naming option from one or more menus on the right. Look at the Example to verify your naming convention choice.

If you chose a naming option that uses sequential (serial) numbers, enter a one- to four-digit starting number in the Starting Serial # field.

Check any or all of the file-name Compatibility options for the platforms in which you need the files to be compatible.

9. Click OK to start the batch processing.

Image You can also play an action on a batch of images via File > Scripts > Image Processor in Photoshop or Tools > Photoshop > Image Processor in Bridge. In the dialog, check Run Action, then choose an action set and an action from the menus.

Image When you play an action on an image, provided the last step in the action doesn’t close the document, the action steps are listed as states on the History panel.

Image To stop the batch command while it’s processing, press Esc, then click Stop in the alert dialog.

An action can be turned into its own little mini-app, called a droplet, that sits on the Desktop or in a folder, waiting to be triggered.A If you drag a file or a folder full of files onto a droplet icon, Photoshop will launch (if it’s not yet running), and the action that the droplet represents will be played on those files. Droplets can be shared among Photoshop users.

Image

A This is a droplet icon for an action.

To create a droplet for an action:

1. Choose File > Automate > Create Droplet. The Create Droplet dialog opens.B

Image

B Use the Create Droplet dialog to choose a location and other options for your action droplet.

2. Click Choose. The Save dialog opens. Enter a name in the Save As field (keep the extension), choose a convenient location for the droplet, then click Save to return to the Create Droplet dialog.

3. Choose an action set from the Set menu, then an Action to be saved as a droplet.

4. Check any Play options to be included in the droplet, and choose Destination and Errors options for the processed files (see steps 4–8 on page 430).

5. Click OK. The droplet will appear in the designated location.

6. To use the droplet, drag a file or a folder full of files onto it in Explorer/Finder. Photoshop will launch, if it’s not already running, and the action will play on the files.

Editing an action

If you want to experiment with an action or add to it without messing around with the original, duplicate it, then edit the duplicate.

To duplicate an action:

Do either of the following:

Click an action, then choose Duplicate from the Actions panel menu.

Drag an action over the New Action button Image on the Actions panel.

Image To rename an action, double-click the name.

When you insert a Stop in an action, the playback will pause at that point so the user can perform a manual or nonrecordable edit (e.g., choose a source point for a cloning tool or create a selection at a specific size and location). You can also include an instructional message for the user, which will appear in an alert dialog when the pause occurs, such as a directive to use a tool in a specific way or to choose specific panel settings. After completing the manual edit, the user resumes the playback by clicking the Play button.

To insert a Stop in an action:

1. Do either of the following:

While recording an action, pause at the point at which you want the Stop to appear.

To add a Stop to an existing action, on the Actions panel, click the command name after which you want it to appear.

2. Choose Insert Stop from the Actions panel menu.

3. In the Record Stop dialog, type an instructional or alert message.A We recommend also spelling out in the message that after clicking Stop and performing the desired edit, the user should click the Play button to continue the playback.

Image

A In the Record Stop dialog, we typed an instructional message for the user. We also checked Allow Continue to add a Continue button to the alert dialog, which will appear when the action is played.

4. Optional: Check Allow Continue to include a Continue button in the alert dialog (in addition to a Stop button). If the user opts not to perform the requested manual edits, he or she can click Continue to resume the playback (instead of having to click Stop, then click the Play button on the panel). Don’t check Allow Continue if the requested manual edit is essential to the user’s execution of the remaining steps in the action (e.g., the creation and positioning of a selection).

5. Click OK. The Stop listing will appear below the command you paused after or clicked in step 1.B–C If you expand the Stop listing, you will see your instructional message.

Image

B The Stop command appeared as a step within the action.

Image

C When we played the action on an image, our instructional message and a Continue button appeared in this alert.

6. If you’re creating a new action, record the remaining edits that you want it to contain, then hit the Stop Playing/Recording button. Image

Perhaps you neglected to include a particular menu command when you initially recorded an action. The Insert Menu Item command gives you a second chance. Also, some menu commands (e.g., on the View or Window menu) can’t be included when an action is initially recorded. Using this feature, you can insert those commands afterward.

To insert a menu item into an action:

1. Expand the listing for an existing action, then click the command after which you want the new menu command to be inserted.

2. From the Actions panel menu, choose Insert Menu Item. The Insert Menu Item dialog opens.

3. From the Photoshop menu bar, choose the command to be added to the action. The command name appears in the Insert Menu Item dialog.A

Image

A When we chose the Fill command from the Edit menu, the command name appeared automatically in the Insert Menu Item dialog.

4. Click OK.B

Image

B The menu item that we inserted appeared as a listing within the action on the Actions panel.

5. If the menu command that you inserted requires user input in a dialog, you will need to add a modal control to the action for that command. See the first task on the next page.

If you forgot to include a particular command or editing step in an action, or you want to improve an action by adding a command, here’s your second opportunity.

To add a command or edit to an action:

1. On the Actions panel, expand the listing for the action to which you want to add an edit, then click the command name after which you want the new edit to appear.

2. Click the Begin Recording button. Image

3. Execute the desired command(s). Note: You can’t add a command that’s available only under certain conditions (e.g., the Feather command, which requires an active selection) unless those conditions are present and the creation of those conditions is also recorded as steps in the action.

Image To record an action that produces different results depending on whether a specified condition is detected in the document, see pages 436438.

4. Click the Stop Playing/Recording button. Image

Image To expand or collapse all the steps that are nested within an action, Alt-click/Option-click the arrowhead next to the action name.

You can enable a pause, called a modal control, for any step in an action that enables user input, such as a dialog in which the user chooses custom settings or an edit that requires Enter/Return to be pressed (such as a transform command).

To add a modal control to a command in an action:

1. Put the Actions panel in List mode, and expand the list for an action.

2. For any individual listing within the action, click in the second column; the Dialog icon Image appears.A

Image

A Via the Dialog icon, you give the user an opportunity to enter custom settings in a dialog when it opens during playback.

When the action is played, it will pause when it encounters the command that has that modal control, and the dialog or on-canvas controls will appear onscreen. In the case of a dialog, the user can enter new values, or accept the original recorded settings just by clicking OK, or click Cancel. When the user exits the dialog or commits to the edit, the playback continues automatically.

Image To toggle a modal control off, click the Dialog icon.

To enable or disable all modal controls for an action:

Click in the Dialog column for an action name. Depending on their current state, all the modal controls in the action will be turned on or off. If an alert prompt appears, click OK.

Note: A short horizontal line in the Dialog icon Image for an action listing indicates that the modal controls in the action are in a mixed state (some off and some on). To reset the modal controls to their original state, click the Dialog icon; if an alert prompt appears, click OK.

To re-record an action using different dialog settings:

1. Click the name of the action that contains the settings to be edited.

2. From the Actions panel menu, choose Record Again.

3. The action will play back, stopping at each command that uses a dialog. Enter new settings where needed, then click OK. Each time you close a dialog, the re-recording continues.

4. The action will stop automatically after the last command. If you want to halt the re-recording midstream, click Cancel in a dialog.

When you insert a conditional step into an action, it will test for a specified condition in the documents in which it is played, then will play one of two other additional specified actions (or none) based on whether or not that condition is detected.

To add a conditional step to an action:

1. Create two actions that accomplish an editing task in different ways: one that performs specific edits when a specific condition is found A and another that performs alternative edits (or no other edits) when that condition is not found.B Save both actions in the same set.

Image

A In the sequence of steps shown on these two pages, we created an action that adds a white border with extra white space on the bottom if played on a horizontal image, or adds extra white space on the right if played on a vertical image. To begin, we created an action called “Border Landscape,” used Image > Canvas Size to add a uniform white border around the image, then used the command once more to add extra canvas area to the bottom of the image.

Image

B We created a second action called “Border Portrait” in which we used Canvas Size first to add a uniform white border, then a second time to add extra canvas area to the right side of the image.

2. To create a third action that is designed to test for the specific condition, click the New Action button Image on the Actions panel. In the New Action dialog, enter a Name, and from the Set menu, choose the same set as in step 1. Click Record.

3. Optional: On the History panel, create a snapshot of the current state of the document.

4. From the Actions panel menu, choose Insert Conditional. The Conditional Action dialog opens. From the If Current menu, choose the condition for which you want documents to be tested.C

Image

C Next, we created a third action called “Add Border.” To enable this action to detect the orientation of documents on which it is played, we chose the Insert Conditional command, then from the If Current menu in the Conditional Action dialog (shown at left), we chose Document Is Landscape.

5. Choose from the other two menus in the dialog, (the menus will list only actions in the current set):

From the Then Play Action menu, choose the action to be played when the specified condition is detected in documents on which it is played (see step 1 on the preceding page).

From the Else Play Action menu, choose the alternative action to be performed when the specified condition is not found,A or to prevent any alternative action from being played, choose None.

Image

A From the Then Play Action menu, we chose our Border Landscape action, and from the Else Play Action menu, we chose our Border Portrait action.

6. Optional: Perform any additional editing steps to be played by the original action after the conditional action step is completed.

7. Click the Stop Playing/Recording button. Image B

Image

B Our last step was to click the Stop Playing/Recording button on the Actions panel. The “Add Border”action now contains the conditional “If” command.

8. To test the three actions that you created in this task, open an image that contains the condition you chose in step 4 and another image that doesn’t contain that condition.

9. On the Actions panel, click the action that tests for the specified condition, then click the Play button. Image C–D Click in the second document, then play the action again.

Image

C When we played our Add Border action on this photo, because the conditional step in the action detected the “Document is Landscape” condition, it played the Border Landscape action. Now there’s room for some type ...

Image

D In this photo, the same action detected that the Document is Landscape condition was not present, so it played the alternative action that we specified for this scenario, which was Border Portrait.

10. When you’re ready to play the action containing the conditional step on multiple files, use the Batch command (see pages 430431).

To change the settings for a command in an action:

1. On the Actions panel, Image expand the listing for an action, then double-click a command that uses a dialog for which you want to change the settings.

2. Enter new settings.

3. Click OK.

This may seem obvious, but remember that if you change the order of edits in an action, the new sequence may produce different results than the original.

To change the order of edits in an action:

1. On the Actions panel, expand the list for an action, if it’s not already expanded.

2. Drag a command upward or downward on the list.

Deleting commands and actions

You can delete a whole action, or just delete individual commands from an action.

To delete an action or delete a command from an action:

1. If you created (or edited) any custom action sets that you want to preserve for future use, follow the steps in “To save an action set to a file,” at right.

2. On the Actions panel, click the individual command or action to be deleted, then, if desired, Ctrl-click/Cmd-click to highlight additional commands or actions.

3. Click the Delete button, Image then click OK (or to bypass the prompt, Alt-click/Option-click the Delete button).

Saving and loading action sets

Be sure to save any custom or edited action sets that you want to preserve for future use. Saved action sets can be shared among Photoshop users.

To save an action set to a file:

1. On the Actions panel, click the action set to be saved.

2. Choose Save Actions from the panel menu.

3. In the Save dialog, type a name for the action set file, keep the extension and default location, then click Save. Each file is regarded as one set, regardless of how many actions it contains.

4. When you relaunch Photoshop, your newly saved set will appear on the Actions panel menu. Note: If you edit any actions in the set, you will need to resave the set by following the steps above.

Photoshop includes many useful actions beyond those in the default set. To load them on the panel, or to load any user-created set, follow the instructions below.

To load a set onto the Actions panel:

1. On the Actions panel, click the set name that you want the loaded set to appear below.

2. From the Actions panel menu, choose a predefined action set (Commands, Frames, Image Effects, LAB–Black & White Technique, Production, Stars Trails, Text Effects, Textures, or Video Actions), or a user-saved set.

To reload the default action set:

From the Actions panel menu, choose Reset Actions. In the alert dialog, click Append to add the default set to the existing sets on the panel, or click OK to replace the existing sets with the default one.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.227.9