Jake Intel

Veronique Morrison

Photoshop Scripts

  • By Veronique Morrison
  • June 23, 2011
  • Design
What are Photoshop Scripts?

Scripts serve as a great tool to assist designers in increasing their workflow by automating repetitive tasks, customizing commands and even adding new features. Although they debuted way back with version 7, it is surprising how few people even know they exist. Originally scripts were an optional plug-in available via download, but today they come built into the program with a few useful scripts preloaded.

Scripting allows you to combine the power of Photoshop’s tools with custom programming. The feature allows users to write scripts using JavaScript, VB Script, or AppleScript, to do what you can’t with your mouse and keyboard—or simply don’t feel like spending your time on. The scripts are fairly basic, but for those of us not up to the challenge of learning to write custom scripts—there are plenty of freebies available online.

Why Scripts, Not Actions?

Photoshop Scripts are way more powerful than actions or batching and can be as smart as you make them. Some examples of the powers of scripting include:

  • You can add conditional logic, so that the script automatically makes “decisions” based on the current situation. For example, you could write a script that decides which color border to add depending on the size of the selected area in an image: “If the selected area is smaller than 2 x 4 inches, add a green border; otherwise add a red border.”
  • A single script can perform actions that involve multiple applications. For example, you could target both Photoshop CS2 and another Adobe Creative Suite 2 Application in the same script.
  • You can open, save, and rename files using scripts.
Installing a Photoshop Script

Installing scripts is super simple. First download the script (or create your own), then save it into the specified scripts folder.

  • PC: C:Program FilesAdobePhotoshopPresetsScripts
  • MAC: Applications > Photoshop > Presets > Scripts.

After copying a script to this folder you’ll need to Quit and then Restart Photoshop before the script appears in the File> Scripts menu.

Examples of Pre-loaded Scripts

Photoshop comes with a few useful scripts right out of the box. Once the program is installed, you can find them under File > Scripts. One example includes:

Layer Comps to Files
This one does exactly what it says, outputting your Layer Comps to separate files. Layer comps are an easy way to create “snapshots” of your comps in various states. Using the script, you can output the comps to various files types PSD, JPG, and GIF. If you have clients who like to see everything in PDF format, there’s also “Layer Comps To PDF” which outputs the layer comps into a single PDF document with multiple pages.

Examples of Free Add-On Scripts

As mentioned previously, you can find tons of free scripts online. Some scripter sites will even write custom scripts for you on request. A few timesaving scripts include:

Remove Copy From All Layers
If you create multiple comps and layers sets in your files and are anal like me, having the word “copy” in half your layers is an annoying Photoshop feature. It takes time to go through each layer and manually remove the word “copy”. Luckily, someone else thought the same thing and created a script to remove them all at once. It removes the word copy and also the number next to it, so “mylayername copy 12” becomes simply “mylayername”.

Download the script here

NOTE: CS5 now has a built in option to turn this off, so you don’t need the script. You can set it in your layer palette options.

Text Export
This script will export all your layers to a text file so you can easily convert to HTML without having to copy and paste. For example, if you have 3 text layers:

(Layer 1) Lorem ipsum
(Layer 2) This is a headline
(Layer 3) Submit

You run the script and you get a text file with these contents:

Lorem ipsum
This is a headline
Submit

Download the script here

Links and References

Here are a few useful links to learn more about Photoshop scripts:

Trevor Morris Photographic

Jeff Tranberry

Adobe, Photoshop Scripts

PS-Scripts

Kirupa Tutorials