Using Actions to Automate Tasks in Photoshop

Photoshop action (ATN)

While Adobe Photoshop has a host of automation tools, one of the most versatile and powerful of them is called an action. In fact, some of the other automation commands, such as batches and droplets, derive their functionality from actions.

An action is like a macro or script; however, while scripts have a reputation for being confusing and difficult, actions are very easy to create. If you know how to use Photoshop, you know most of what you need to create your own actions.

For example, let's say that you have 100 digital photos that you'd like to post on the Internet. Normally, you'd have to load each one, scale, color correct, sharpen, and then save them one at a time. Alternatively, you could create an action that does all the "dirty work" for you — and best of all, you'll get consistent results in far less time than you could've achieved by doing it manually!

Although actions can be used to automate all sorts of tasks, some common uses include:

To better understand actions, let's begin with a comprehensive overview of the Actions panel, including the commands available in the Actions panel menu. We'll then use these commands to create a couple of actions of our very own!

Introduction to the Actions Panel

The Actions panel is sort of like a "mini action editor": it allows you to create (record), edit, load, save, delete and play actions (among other things). To show or hide the Actions panel, use the Window » Show Actions command or press the F9 key. The figure below shows the Actions panel in List View Mode (its default mode).

Click on each of the letters below to see the corresponding descriptions.

Actions panel Stop playing/recording Begin recording Play selection Create new set Create new action Delete Set Action Action step Command details Modal control Checkbox Panel menu

A. Stop Playing/Recording

The Stop button (Stop playing/recording) stops action playback and recording. This button is equivalent to pressing Esc or Ctrl/Cmd+.. You can also stop recording by choosing Stop Recording from the Actions panel menu (Panel menu).

B. Begin Recording

Push the Record button (Begin recording) to begin recording a new action or to add additional commands to an existing action. If an action itself is selected, new commands are appended to the end of the action. If an action step is selected, new commands are inserted after the current action step. You may also begin recording by choosing Start Recording from the panel menu.

Note: You may rerecord the parameters for a command by double-clicking on its associated action step. If available, the command dialog will appear allowing you to enter new values. Choose OK to apply the new settings or Cancel to leave the original settings.

C. Play Selection

If an action is selected, pushing the Play button (Play selection) plays the entire action. If an action step is chosen, the action will begin playback from the currently selected command. You may also choose Play from the Actions panel menu.

Tip: To play only the current action step, Ctrl/Cmd-click on the Play button or Ctrl/Cmd-double-click the desired action step.

D. Create New Set

New Set dialog Press the Create New Set button (Create new set) to create a new action set. A dialog will appear, prompting you for the set's name. This button is equivalent to choosing New Set from the Actions panel menu.

Tip: Alt/Opt-click the New Set button to skip the dialog and simply accept the default name for the new set. You can also drag-and-drop an existing set onto the New Set button to duplicate it (which is equivalent to choosing Duplicate from the panel menu).

E. Create New Action

New Action dialog Press the Create New Action button (Create new action) to add a new action to the selected set. A dialog will appear, prompting for the action's name, associated set, keyboard shortcut and Button Mode color. This button is equivalent to choosing the New Action command from the Actions panel menu.

Tip: Alt/Opt-click the New Action button to skip the dialog and simply accept the default name (and settings) for the new action. You can also drag-and-drop an existing action onto the New Action button to duplicate it (which is equivalent to choosing Duplicate from the Actions panel menu).

F. Delete

As you might expect, the Delete button (Delete) deletes the selected set, action or command. A dialog appears to confirm your intentions. Alternatively, you may access the Delete command from the panel menu.

Tip: Alt/Opt-click the Delete button to delete the selected item without confirmation. This is equivalent to dragging the desired item onto the Delete button.

Delete operations performed in the Actions panel are not added to the history, nor can they be undone via the Edit » Undo command; however, you may undo/redo the last delete operation by pressing Ctrl/Cmd+Z.

G. Action Sets

Sets behave much like folders, in that they allow you to organize your actions. Double-click on a set (or choose Set Options from the panel menu) to change its name.

H. Actions

An action is basically a Photoshop macro containing one or more pre-recorded commands that may be replayed on another image (or series of images). Actions can only exist within a set (i.e., they can't be created in the Actions panel outside of a set). Double-click on an action (or choose Action Options from the panel menu) to change its name, keyboard shortcut and Button Mode color.

I. Action Steps (Commands)

Action steps are pre-recorded Photoshop commands. Actions are comprised of one or more action steps.

Tip: Alt/Opt-drag-and-drop an existing action step to duplicate it (which is equivalent to choosing Duplicate from the panel menu).

J. Command Details

Expanding an action step (by clicking on its associated disclosure icon, Disclosure icon) reveals the details/values that were set for the command at the time it was recorded.

Note: You may change the parameters for a command by double-clicking on its associated action step (or by choosing Record Again from the panel menu). If available, the command dialog will appear, allowing you to enter new values. Choose OK to apply the new settings or Cancel to leave the original settings.

The modal control is used to enable/disable a command's dialog; hence, it's only available for commands that have an associated dialog. If enabled, a small dialog icon (Modal control) appears next to the command, and the associated dialog is displayed for that command during action playback. The default is to not display a dialog (indicated by an empty box), and instead, to use the values that were recorded for the command when the action was created.

Note: Enabling (or disabling) the modal control for a set toggles all dialogs for all actions within the set. Similarly, enabling (or disabling) the dialog checkbox for an action toggles all dialogs for all applicable commands within that action.

A red modal control icon (Modal control) indicates that one or more (but not all) dialogs are enabled within an action (or set).

A grey "ghosted" modal control icon (Modal control) can mean one of two things:

  1. the dialog has been enabled, but the command, action, or set has been excluded; or
  2. the command was inserted without values, via the Insert Menu Item command (in which case, you'll be prompted for values during action playback).

L. Include Checkboxes

The include checkbox (Include checkbox) is used to turn action steps — or even entire actions or sets — on or off. By default, all commands are checked, indicating that they are to be included when an action is played. An empty checkbox indicates that the command has been disabled (excluded), meaning that it will be skipped during playback.

Note: Enabling (or disabling) the include checkbox for a set toggles all steps for all actions within the set. Similarly, enabling (or disabling) the include checkbox for an action toggles all steps within that action.

A red checkmark icon (Include checkbox) indicates that one or more (but not all) steps within an action (or set) have been disabled.

In addition to the many controls discussed above, the Actions panel menu also contains several commands that are very useful for creating and editing actions. To access the panel menu, click on the Panel menu button, near the top right corner of the Actions panel.

Button Mode

Button Mode By default the Actions panel appears in List View Mode. Button Mode turns each action into a button displaying the name, color and keyboard shortcut assigned to it in the Action Options dialog. Simply click a button to play its corresponding action.

To turn Button Mode off (and return to List View Mode), simply choose Button Mode again from the panel menu.

Despite how easy Button Mode is to use, its usefulness is limited because you can't create, edit or modify actions while in this mode.

Insert Menu Item

The Insert Menu Item command allows you to insert the selected menu item into the current action. Inserted items appear below the active action step. This command is available regardless of whether or not you are in record mode.

Insert Menu Item dialog

Two key uses for this command are:

  1. to insert commands that might otherwise be unavailable (or inaccessible) while in record mode (such as showing or hiding panels); or
  2. to insert a command without values (and display a prompt during action playback).

Insert Stop

Record Stop dialog A stop is a dialog that pauses the action to display a user-defined message of up to 254 characters. The dialog has a Stop button (hence the name), and may also contain an optional Continue button.

Typical uses for a stop include:

  1. to display instructions or copyright/version information; or
  2. to stop playback, allowing the user to perform manual tasks such as painting, or inserting text, prior to resuming playback.

Insert Path

Insert Path is only available when a path (or shape) is selected. This command inserts the selected path into the current action as a series of anchor and handle coordinates.

Tip: Set the ruler units to percentage before using this command to ensure that the path is sized and positioned relative to the canvas, regardless of the canvas' dimensions.

Set/Action Options

Use the Set Options/Action Options command to rename an action/set, or to change its function key or Button Mode color. You can also double-click on an action/set to access the Options dialog.

Tip: Assigning a keyboard shortcut allows you to execute an action by simply pressing the assigned key(s). You can even use actions to assign keyboard shortcuts to frequently used commands that don't have shortcuts (e.g., Edit » Stroke, or Select » Modify » Contact). See below for an example of how to do this.

Playback Options

Playback Options dialog The Playback Options dialog allows you to set the playback speed for actions.

  • Accelerated plays actions as fast as possible (desirable for most circumstances);
  • Step by Step allows the screen to refresh between commands (useful for debugging); and
  • Pause For pauses between commands for the defined number of seconds (between 1 and 60).

The Pause For Audio Annotation option allows you to pause action playback for documents that contain audio annotations.

Clear All Actions

As the name implies, Clear All Actions removes all actions (and sets) from the Actions panel.

Tip: This command cannot be undone via the History panel, nor the Edit » Undo command; however, you can undo/redo the last operation by pressing Ctrl/Cmd+Z.

Reset Actions

Use the Reset Actions command to remove all actions from the Actions panel and replaces them with the default sets. A warning dialog appears, allowing you to accept the replacement, cancel it, or append the default sets to the Actions panel.

Tip: Hold down the Alt/Opt key when choosing this command to skip the warning. This command can also be undone by pressing Ctrl/Cmd+Z.

Load Actions

Load Actions allows you to load an existing action set. You can also load actions by choosing them (by name) from the bottom of the panel menu, by double-clicking on them in Explorer/Finder, or by dragging and dropping them onto the Photoshop application window.

Note: In order for an action to appear in the panel menu, it must be saved in the Adobe Photoshop CS#\Presets\Actions\ folder (or subfolder).

Replace Actions

Replace Actions replaces all actions (sets) in the Actions panel with those that you select.

Save Actions

Although the contents of the Actions panel are remembered from one session to the next, they're not actually saved until you physically save them using the Save Actions command. In fact, you can't use either of the above commands (Load Actions and Replace Actions) for a set until it's first been saved.

Also, note that you can't save individual actions, only sets. If you want to save a single action, it must be placed into its own set. The best place to save your actions is in the Adobe Photoshop CS#\Presets\Actions\ folder (or subfolder).

Creating a Simple Action

Okay, enough theory. Time for something practical...

How many times have you double-clicked on a layer to rename it? Wouldn't it be cool to have a keyboard shortcut to do this? Well, why not make your own? Once you get used to using it, you'll wonder how you ever managed without it!

Before you begin recording an action, it's always useful to think through the steps involved. For this example, you could record an action that renames a layer using the Layer Properties dialog; however, it would always name layers using the same name – not very useful. We could turn on the modal control (Modal control icon), but the default name would still always be the name that was recorded with the action. Instead, we'll use the Insert Menu Item command, which inserts the command without assigning any values to it.

1

New Set dialog Make sure the Actions panel is visible by pressing F9 (Window » Show Actions).

Add a new set by pressing the Create new set button (Create new set). Name the set "Shortcuts" (or whatever you like).

2

New Action dialog Create a new action by pressing the Create new action button (Create new action).

When the New Action dialog appears, enter "Layer Properties" for the Name. Assign F2 as the Function Key, since that's typical shortcut for rename (on Windows, at least). Leave "Shortcuts" as the designated Set, and then select a Button Mode color if you wish.

Begin recording by pressing the Record button.

3

Next, choose Insert Menu Item from the panel menu (Panel menu). When the Insert Menu Item dialog appears, choose Layer » Layer Properties from the main application menus, then press OK. Notice that an action step called "Select Layer Properties menu item" has been added to the action.

Insert Menu Item

4

Stop recording by pressing the Stop button (Stop playing/recording).

Finished Action That's it! Now let's try it out. Create a new document (Ctrl/Cmd+N, File » New) and add several new layers by pressing Ctrl/Cmd+Alt/Opt+Shift+N. Select a layer and press F2. When the Layer Properties dialog appears, name the layer and try it again on another layer.

Tip: Another shortcut for quickly adding layers is to Alt/Opt-click on the New Layer button (Create a new layer) at the bottom of the Layers panel.

Remember: Don't forget to save your actions by choosing the Save Actions command in the Actions panel menu! Read the Save Actions description above for more details.

Creating a More Complex Action

Action results That was fun, but now let's try something a little more complicated.

For this example, we'll create an action that mirrors the active layer across both the vertical and horizontal axes — and we'll do this on a separate layer to ensure that the original layer remains unaltered. Finally, we'll center the results on the canvas. Once you've finished, you'll be able to use the action to create symmetrical shapes, repeating patterns, and refrigerator art. ;)

1

First, we'll need an image that we can use for recording and testing our action. You can create your own, or just download the sample file from the downloads section below.

2

Assuming the Actions panel is already visible, create a new set (Create new set). Name the set "Mirror Corners". Add a new action to the set (Create new action). Name the action "Mirror Corners 1.0", and assign a function key and Button Mode color if you wish. Finally, begin recording by pressing the Record button.

3

Because we're going to duplicate the current layer (to preserve the original artwork), we'll hide the layer so that it doesn't obstruct the view of the final results. Click the visibility icon (Layer visibility) associated with the current layer. Notice that a command called "Hide current layer" has been added to the action.

4

Actions panel Next, duplicate the current layer by pressing Ctrl/Cmd+J (Layer » New » Layer via Copy). Turn on the new, duplicated layer by clicking on its visibility icon. Both commands should appear in the action.

5

Free Transform In this step we'll use the Edit » Free Transform command to flip a horizontal duplicate of the current layer.

Tip: Hold down the Alt/Opt key while choosing Edit » Free Transform to transform a duplicate of the original selection.

Press Ctrl/Cmd+Alt/Opt+T. In the Options panel, set the Reference point location to the right side (Reference point location); then right-click in the document window and choose Flip Horizontal from the context menu. Press Enter to accept the transformation.

6

Merge the two halves/layers by pressing Ctrl/Cmd+E (Layer » Merge Down).

7

Now flip the current layer vertically using the same technique. Press Ctrl/Cmd+Alt/Opt+T to initiate Free Transform. In the Options panel, set the Reference point location to the bottom (Reference point location); then right-click in the document window and choose Flip Vertical. Press Enter to accept the transformation.

8

Again, merge the two halves together by pressing Ctrl/Cmd+E.

9

To center the pattern, first select the entire canvas by pressing Ctrl/Cmd+A (Select » All); then, with the Move tool selected, press the Align vertical centers button (Align vertical centers on the Options panel), followed by Align horizontal centers (Align horizontal centers).

Drop the selection by pressing Ctrl/Cmd+D (Select » Deselect).

Note: The alignment commands are also available via the menus: Layer » Align To Selection » Vertical Centers, and Layer » Align To Selection » Horizontal Centers.

10

Completed action Stop recording by pressing the Stop button (Stop playing/recording).

As a final touch, let's add a Stop message to let other users know what this action does. Choose Insert Stop from the Actions panel menu (Panel menu). Enter a brief description about what the action does and then enable the Allow Continue option.

Since we want the message to be displayed at the beginning of the action, drag the newly added stop to the top of the action, above the Hide current layer command.

Note: If you want the message to be present in the action, but not displayed each time the action is played, simply uncheck the Include checkbox (Include checkbox) for the Stop.

Now try your new action on different patterns and image sizes to make sure it works properly. Finally, don't forget to save the action using the Save Actions command.

Tips for Editing Actions

Here are some tips for editing your actions:

Tips and Guidelines for Creating Actions

Keep things generic

Reduce, reuse and recycle

Consideration for other users

Managing your actions

Useful Resources

For a great source of free actions, visit Adobe Exchange . Registration is free, and allows you to upload your actions to share with other users.

And if you want to learn even more about actions — a lot more — check out Danny Raphael's Photoshop Actions Tutorial , a mammoth document that covers every aspect of actions in exhaustive detail.

Downloads

To download the files below, you may need to right-click on the provided links (Ctrl-click on the Mac), and choose "Save Target As".

Download Size Description
ATN Shortcuts 0.2KB The completed action from the simple example (above)
ATN Mirror Corners 2KB The completed action from the complex example (above)
PSD Test Pattern 49KB A sample pattern to be used with the complex example (above)
 

If you enjoyed this tutorial, please consider supporting this site. As always, I welcome your feedback and suggestions.