Photoshop Actions Mini Course (Part 4)
We will continue our journey with Photoshop actions. In this post we will cover some limitations of the actions. While Photoshop allows you to do anything that you can imagine with digital images, actions have some limitations. Before we proceed, let me give you link to download action set file with solution for homework from lesson 3. Just to remind you, I have asked you to record steps which will ensure that action won't fail regardless of the color mode and bit depth of the source file. It was an easy task because we already have step to flatten the image so your task was to add 2 additional Convert Mode steps at the beginning of action. You could do that using Insert Menu Item > Image > Mode > RGB Color and Insert Menu Item > Image > Mode > 8 Bits/Channel.
What is actually complex with Photoshop actionsIt is not a number of steps. As we have seen in previous lessons, action can contain hundred of steps which are actually one or two commands duplicated as many times as you want. Complexity starts with limitations and how to solve problem with limitations.
If you have experience with actions, then you already know how developers are solving some problems with limitations. Sometimes developers are splitting action, other times they are providing assets and even instructing users to stop then to resume playing actions. With some actions you will get instructions, actual info about requirement that the image must be at a certain aspect ratio, orientation or even to have certain dimensions.
As you already know, almost everything can be done in a couple of different ways, but that may or may not be a good / desired solution. What developers have are modal controls, stops, percentage based inputs and sliders plus creativity to solve certain limitations.
Let me give you some light on the subject
If your action contains step with the Stroke command, then you are about to use modal control and to allow yourself or any other user to manually set Stroke Width. Actions cannot perform calculations and to set Stroke Width based on document dimensions. On the other side, we have pixels as measurement unit for Stroke Width, not percentages.
In case you want to create square selection, for example, then you can use Insert Path command and percentages for measurement unit while recording command. That's fine and you will have recorded flexible command with one limitation: shape or shape's anchor points will depend on document's or canvas shape. We will cover that with more details as we proceed with the course.
Sometimes you will want to add adjustment layer, for example, on top of the layers stack. You can use keyboard shortcut to select the topmost layer then to insert adjustment layer, but what if top most is the layer group in your Layers panel? Group instead of the layer will be selected and adjustment layer will be added to the group in case group is expanded. Ok, you will collapse the layer group. Which command you will use to collapse the layer group? There isn't such command in Photoshop nor keyboard shortcut. In fact, expand/collapse layer group will not be recorded. There is an easy solution for this problem, but this is an easy example.
Let's see what are some limitations that you must take into account when recording actions
Limitations when recording Photoshop actions and some solutions:
Photoshop action cannot do nothing outside of Photoshop. In case you have placed Illustrator file as a Smart Object then you can open it in Illustrator, but not and to control changes that should be made. You can not record command to create a folder on your drive nor to use sequence numbering or to add a suffix or prefix to the file name. The solution is to use Image Processor Pro which can create folder and handle custom name or to append a suffix and prefix to the file name.
You cannot record path drawing (newer versions CS6 and later has Allow Tool Recording option in the Actions panel menu and can record path drawing with some limitations) , but you can use Insert Path command.
Photoshop action cannot calculate and make decisions based on calculation, you cannot record command to use 5px stroke only if document dimensions are above 2000px in width. Some commands have percentage based sliders while other commands have modal control.
You cannot record certain operations like tool switch, to define variable, to expand/collapse layer group. Use stops to instruct user or to remind yourself what to do before resuming playing action or record additional steps in action to achieve what you want.
Clicking on the layer while recording action will record layer name and that also can be a limitation because the layer with exact same name must be present in the document when playing action. If there are multiple layers with the same name, then bottom most layer with matching name will be selected and targeted.
Other things worth to know
Some commands will not do exactly what is your intention. Command: Move current layer To: front layer (move layer to the top of the layers stack) will work in some situations. In case document have layer groups and nested groups and layer in some of the nested group is currently selected, it won't actually move layer to the top of your layers stack. You can repeat the same command multiple times to ensure that current layer will be at the top of the layers stack above all other layers.
Some commands will display error message while the other will proceed even when not executed without error message. Examples: Flatten Image will not display an error message even if you have only Background layer while: Select front layer will display an error message if there isn't at least one normal layer (which is not Background) in the Layers panel.
When things start to be complex
Things start to be complex when you want to record flexible action for every situation without to split action and without stops to resume playing after doing something manually. Even simple actions can appear complex because you have to deal with the requirements and with limitations. Most of the beginners actually count only actions with maximum flexibility for useful actions and usually are trying to record them immediately after they learn how to record simple action. Can you recognize yourself? Well, you are not alone, I did the same thing when I get started recording actions.
Using keyboard shortcuts when recording actionsKeyboard shortcuts are very important in the process of recording Photoshop actions. Using keyboard shortcuts you can increase flexibility, compatibility and speed up the process of recording actions. As already mentioned clicking on the layer while recording an action will record layer name what can be limitation caused by you. Selecting layer using keyboard shortcut will give you flexibility and increase compatibility because "Background" layer is not present in localized versions of Photoshop (it is present but not with the name Background). Another aspect is that you can use keyboard shortcuts, even custom keyboard shortcuts to speed up the recording process. Photoshop will never record shortcut, it always record command. If you need to convert layers/groups to Smart Object multiple times, then go and assign keyboard shortcuts to command: Convert to Smart Object.
Let's record flexible (complex) actionIt's time to record one action for everyday use with maximum flexibility. Let's say you like to use a High Pass filter to sharpen your images. We are sharpening images at the end of image processing and we want our merged Smart Object layer at the top of the layers stack with flexibility to change the Radius amount if needed.
I will skip what we already have learned: how to create action and start recording it. You can use Exercise action set or just create new one, it's really up to you and I will try to minimize steps and explanations focusing on what is most important. Give a name to the action: High Pass. To get started open any image/file with few layers or just create a blank new file and add few layers. Ensure that top most layer/group is not selected.
Step 1 Record step Select front layer
According to our goal, we should record step to select the top most layer in our composition. Press Alt/Opt + . (period) on your keyboard. Now you have step: Select front layer recorded.
Step 2 Record step Merge visible
We want to merge all visible layers, right? It is a non-destructive work flow which will give us ability to keep all layers below merged intact, in case we want to go back or to discard what have been done on the merged layer. We will use keyboard shortcut again: Shift + Alt/Opt + Ctrl/Cmd + E. Now you have one more step in action: Merge Visible.
Step 3 Convert merged layer to a Smart Object
For flexibility we will convert the merged layer to Smart Object using: Filter > Convert for Smart Filters command. Hopefully you can see the added command: Convert to Smart Object in your Actions panel.
Step 4 Change blend mode for merged layer
Before recording step with High Pass filter we will change the blending mode to Overlay. We want a live preview of actual results while setting Radius in the High Pass dialog. With merged layer converted to Smart Object go and change blending mode for that layer to Overlay using the drop-down menu at the top left corner of the Layers panel. You will see step: Set current layer added. If you expand it you can see: To: layer, Mode: overlay.
Step 5 Record step with High Pass
Lastly, we are going to record step with High Pass filter. Go to Filter > Other > High Pass. Set Radius to 3.5 Pixels and click OK. You will see step: High Pass added to your action.
Step 6 Stop recording action and enable modal control
Click on Stop playing/recording button in the Actions panel. Click once on the second square from the left side of the High Pass step to enable modal control so you will see High Pass dialog each ad every time when you play action. Purpose of enabling modal control is to display High Pass dialog where you can change Radius which will be used instead of recorded value. You can disable this control if you want to use the same settings for all your images. Congratulations. You have recorded useful action which you can use over and over again.
Test High Pass action
It is time to test our action. You can use the exact same file which is used to record the action or open any other file and test action. Note: you must have at least two layers in your Layers panel, otherwise you will get an error message.
You want more flexibility, right?
Now, if you could make this action work with images/files that have only Background layer! Sometimes you want to sharpen images which do not have layers beside Background or it has single normal layer. If you play action as it is, it will display an error message with non-layered files. There isn't a front layer and you cannot merge visible. What now? You can record another action to duplicate Background layer then to Convert duplicated layer to a Smart Object... In case you want to batch process files, then you can record the third action with Flatten Image step at the beginning of action or to use Conditional actions. Keep in mind that Conditional actions treats file with one layer which is not Background as a layered file.
Woah! Is there simpler solution. Yes, there is the simple solution for those who want one action for every possible situation. We will duplicate already recorded action, add and delete some steps and action will be ready for just any file and any situation.
Here I want to give you some explanation. You can have 9 levels of nested layer groups. When using the command: Move current layer (To: front layer) and you have some layer in a nested group selected, it will actually move the layer to the front layer of that group, not to the top of the layers stack as you may expect. The next occurrence of the command: Move current layer To: front layer will move layer one level up. When a layer group is selected it is not the case. Selected group and all its nested groups will be moved where you probably expect them: to the top of the layers stack.
Modify High Pass action for more flexibilityWe are going to modify our action for more flexibility. Before we start go and duplicate action: High Pass. Double click on the action name to open dialog: Action Options, delete word copy and type: flexible. Ensure that you have at least 3 layers in your Layers panel and that top most layer is not selected, selected layer should be bottom most.
Step 7 Record step Make layer
Select High Pass flexible action and click Begin recording (circle at the bottom of the Actions panel) so you are in recording mode. Click on Create a new layer (page) icon at the bottom of the Layers panel. You should see: Make layer step added to your action.
Step 8 Record step Move current layer
With the newly created layer selected press Shift + Ctrl/Cmd + ] keyboard shortcut. It will move layer to the top of the layers stack. You have step: Move current layer added to your action. If you expand step, then you will see additional info: To: front layer.
Step 9 Stop recording High Pass flexible action
Click on Stop playing/recording action and we are going to delete, duplicate and re-arrange steps.
Step 10 Move, duplicate and delete steps
Select two previously recorded steps: Make layer and Move current layer then drag them to the top of the action. Select step: Select front layer and drag it to the trash can (delete that step). Now duplicate step: Move current layer by dragging it onto the page icon at the bottom of the Actions panel. Repeat that several times to end up with a total of 10 steps: Move current layer. The other steps in action leave as they are so you must have a total of 15 steps from which 10 steps are: Move current layer.
Note: exact same result can be achieved using a similar approach and I will include that action in the action set file which you can download from the link below. Here is what can be also successful solution: after creating blank new layer record step using the command: New Group from Layers what will put a blank layer in the group. The next step should move the group to the top of the layers stack using Move current layer command. Since it is a layer group, one step Move current layer is enough to move group to the top of the layers stack. The next step should be to Merge Group and the rest is exactly the same as for all other actions we have recorded.
Download actions set file with actions recorded for this lesson.
Test action High Pass flexible
Now go and test action with any number of layers in your document. It should work regardless of the number of layers, layer groups and which layer is currently selected. Action still may fail if your document has 32 bits per channel or color mode does not support layers: Bitmap, Multichannel and Indexed Color. This can be addressed by recording two additional steps to convert color mode and bit depth what I will include in the action which I am making available for download. By default those two steps will be turned off and will not be executed unless you turn them on. Another reason for action to fail can be if you do not have any actual content in the document: one or more empty or adjustment layers.
To be continuedWe are done with long explanations and this part of the mini course. Starting from the next tutorial we are going to record actions and to practice. The very first action that we are going to record will use Insert Path command and the resulting action will have maximum flexibility because we are going to use percentages as measurement unit. See you in the next post with Mini Course in the title. If you have any question, please do not hesitate to leave comments or to contact me.
Related tutorials in Photoshop Actions - Mini Course
Photoshop Actions Mini Course Part 1
Photoshop Actions Mini Course Part 2
Photoshop Actions Mini Course Part 3
Product used in this tutorial:
Adobe Photoshop CC 2014
Photoshop Help / About actions and the Actions panel
Photoshop Help / Playing and managing actions
Photoshop Help / Creating actions