The Importance of Scripting
The root of all of this has Photoshop scripting a series of steps for it to follow for itself. When you are recording an action, droplet, or batch, you are invariably creating a programming script that Photoshop is following. You’re just not programming it on your own. There could be times, however, where you will need to work on a much more complex automation projectbeyond what Actions can do for you.
Does this mean that individuals who are not familiar with scripting are left out in the cold? Absolutely not! In fact, Adobe took great steps to ensure that both developers and non-developers alike would get a good jump on creating these scripts by creating the Script Listener plugin.
On your machine, navigate to the Photoshop CS5 folder. You’ll note that there are a series of subfolders present in there, once of which is called Scripting (see Figure 6). In that folder, you’ll find the guides for scripting as well as the Scripting Listener plugin (under Utilities). Copy that plugin into your Plugins/Automate folder and restart Photoshop.
I recommend a few things when you are doing this, however:
- When you start working on a script, go into the SciptingListenerJS.log file and delete any of the entries that are already there. Save the file and close it once that is done. Keep in mind that Photoshop is recording everything into this log file, so it can get very hard to read very quickly.
- Break down any action that you are trying to work on into a series of dedicated steps. If you are trying to duplicate a layer and center it, treat this as two separate steps. Record the duplicating of the layer and copy that out to a separate file. From there, center the layer, and copy that step as a separate text. This will ease any confusion that you may have on what step performs what.
- Try not to include any steps that have you writing or doing things that are valid to just one file. If you create a text layer and write the words “To Remove”, understand that this will be repeated on every image you run the action against. If whatever step you are trying to work on is something that only a few images need, consider doing this step after your batch processes.
- Once you are done with using the Scripting Listener, quit Photoshop and delete the file from the Plugins/Automate folder. This is why you copied the folder instead of moved it. If you leave this plugin running and recording all of your steps, the log file will continue to grow and grow, making the size bigger and bigger. Bad things can happen. By getting used to copying it over and deleting it when you are done, you mitigate this.
Once you have assembled the pieces that you need for your Photoshop project, save the file as a text file with an extension of JSX (see Figure 9). This will let you find and execute the file from Photoshop.
Start Photoshop and go to the File > Scripts > Browse directory. From here you can specify which script file you want to run and you are done!
The great part about working with scripts in this fashion is that you can create actions and droplets that create these steps as well! Simply go to the Actions palette and start recording an action as you normally would. Click on File > Scripts > Browse and run the script that you created. You will notice that inside of the Action, it points specifically to where the script is locatedrunning your script for you. The only thing that you need to keep in mind here is that you should house all of these scripts in a specific location on your computer.
If you transfer the scripts, batches, or actions to other users, they will need to have those specific folders on their computer or will need to re-record the scripts with the locations to the files once again (see Figure 10). Taking a couple of steps of precaution in the beginning and building slowly can turn your Photoshop into an efficiency machine!