Conditional Actions seem odd at first, but are really quite useful. They allow you to use basic programming terms – If, Then, Else – to modify Actions to do different things depending on the makeup of an image. These can work based on image information such as RGB or CMYK, or portrait or landscape – or layer properties such as whether a layer is pixels, vectors or adjustment.
Conditional Actions are great for image processing tasks such as common resizing tasks for the web or pre-press processing, but its ability to respond to layer types makes quite powerful for artworking too.
Here I have two actions that save images for use in a lightbox online. I use the first – 1500 for web – for landscape images to create jpgs that are 1,500 pixels across. The second – 1000 for web – for portrait images.
I want to create a conditional action that automatically runs the right one of these Actions depending on the image itself – which would make applying the action to batches of images easier, using (the File > Automate > Batch command).
I create a new action using the button on the bottom of the Actions panel (Alt+F9). This begins recording, but I want to add a conditional action so press Stop. Then I select Insert Conditional… from the panel’s flyout menu.
In the dialog that appears, I select Document is Landscape for If Current:, 1500 for web for Then Play Action and 1000 for web or Else Play Action. This also means that if the artwork is square, it’ll use the 1000 for web action. If I wanted it to apply the 1500 for web action, I’d need to reverse this so it used Document is Portriat, them 1000 for web and 1500 for web.
Running this action on this lovely portrait artwork by Fabian Ciraolo, I get this image at 1,000 pixels across.