The Photoshop user community is large and it includes some very capable and generous people who have created clever automations that extend Photoshop beyond what the team has created. These automations can take a couple of forms: actions, which most users can make, or scripts, which require real programming knowledge to create, but not to use.
In this section, I’d like to briefly introduce you to both. No, we won’t be creating any scripts because this isn’t a programming manual. But I will discuss how to create and use actions, as well as where to find and how to use scripts.
To create or run an action, you’ll need the Actions panel. There you’ll see a default Set (folder), unsurprisingly called Default Actions. Sadly, they’re not very useful. The most practical actions are those that reliably and quickly perform a series of tedious tasks so you don’t have to.
Consider this scenario: you’re faced with a few hundred images that all need the same multi-step treatment. Perhaps they all need to be cropped to a square format, have their vibrance increased by the same amount, and vignetted so they are darker at the edges. The first step may need intervention to choose which square area is retained.
The process of “recording” would go something like this:
Actual edits. That means zooming (including the Fit on Screen command) is not recorded. Using the Actions panel menu, however, you can choose to insert menu commands and more.
There are many items in the Actions panel menu. Insert Menu Item… gives you a moment to choose one. When an action does resizing, for example, I often like it to end with the image at a viewable size, so I’ll use Insert Menu Item… to insert View > Fit on Screen.
Insert Stop… inserts a dialog box of your own to notify the user that they’re expected to do something in the next step, perhaps, and to give brief instruction. The Allow Continue checkbox will cause a Continue button to appear in the dialog box so the action can continue after the user sees the dialog box. Otherwise, the action stops at the next step and can be resumed only by pressing the play button.
A classic benefit of programming is “if—then—else.” That is, if a certain condition is true, then perform a certain action, else (otherwise) perform a different action. Insert Conditional… provides that programming nicety with its own list of conditions to evaluate. You choose a condition to evaluate, then other actions you’ve recorded that can be played if the condition is true or not. To this end, many users like me record many short actions that do only one or two things. We can then call upon them via a conditional in another action.
Playback Options… are useful too. When testing your action (yes, you very certainly should test your action with several images of varying size and shape), you can set playback to be slow enough to see each step. That way, if something goes wrong, you are likely to see at which step it happens. Return playback speed to Accelerated when it’s ready for production.
The last items in the Actions panel menu are other sets of actions. Some of these may actually be useful, although most use older techniques that may no longer be considered best practices.
I used actions extensively in the preparation of the screenshots that appear in this book. They clean up extraneous layers that my screenshot software introduces, convert to the appropriate color space, set resolution, trim excess image from beyond the useful parts, and more.
It takes every user many attempts to become adept with actions. The mistakes you make will be learning opportunities, however, so try to relish them. If I’m any good at recording actions, it’s because I’ve made literally thousands of mistakes along the way.
These bits of code are “proper” programming with “if—thens” and much more. A number of scripts are to be found within Photoshop itself, or are used to move images from Adobe Bridge to Photoshop with some processing along the way.
In Photoshop’s File menu, you’ll find scripts in the Scripts submenu, of course, and also in the Automate submenu. For example, the Photomerge script is what we use to create panoramic images. It automates the process by performing many separate Photoshop tasks in a way beyond what an action can achieve.
And that’s the point: scripts are telling the application to do things it already does, but in an order and with settings such that it feels like a wholly new feature.
Adobe provides scripting guides at:
https://www.adobe.com/devnet/photoshop/scripting.html
If you have experience with scripting languages, you might try your hand at crafting your own, and these resources will help.
When we use Adobe Bridge to gather a number of images together, we can use scripts we find there to batch process them. From Photoshop, choose File > Browse in Bridge…. Once in Bridge, you can get to scripts by choosing Tools > Photoshop. Yes, they’re mainly the same scripts we see in Photoshop. But it’s often easier to select the images we want to process in Bridge rather than try to pull them into Photoshop or have dozens open at once. With Bridge, we can select hundreds of images and have Photoshop process them.