This website contains various projects I have worked on. Currently, this includes JavaScripts for Adobe applications and general produciton tutorials using Adobe Creative Suite applications. All projects can be accessed from the right-hand menu.

image of a notepad
Creating text labels in Adobe Photoshop

Script Description

This script speeds up the process of adding text tabels to images. If you need to label parts of images as (a), (b), (c), etc. this script can save you some time. First you'll make the first label (a), then using “shift-alt” you will make a copy of that label. Do that for however many labels you need. Positioning them where they should appear. After you have all your (a) labels in position, run the LabelMaker.jsx script to chang the labels to their correct letter designations. The labels will change based on the layer order, so when you run the LabelMaker.jsx script you'll want to just have a background layer and one layer for each label.

Looking at the script

This script creates an array, with one item for each letter of the alphabet. It uses the array to change the contents of a text layer based on the order that it appears. At the end, the script flattens the document.

//========== Label Maker!============\\
/* This Photoshop script will re-label label layers. To create labels, first create label "(a)" preferably with an action.
    Then move this label into postion. Copy this lable and move it into the "(b)" label position. Keep doing this until 
    you have as many lables as you need. Then run this script to change the contents of the labels to what they should be.
*/

var myDocument = app.activeDocument;
var myTotalLayers = myDocument.artLayers.length;
myTotalLayers = myTotalLayers - 1;
myLabelTotal = myTotalLayers -1;

var myLabelContent = new Array();
myLabelContent[0] = "(a)";
myLabelContent[1] = "(b)";
myLabelContent[2] = "(c)";
myLabelContent[3] = "(d)";
myLabelContent[4] = "(e)";
myLabelContent[5] = "(f)";
myLabelContent[6] = "(g)";
myLabelContent[7] = "(h)";
myLabelContent[8] = "(i)";
myLabelContent[9] = "(j)";
myLabelContent[10] = "(k)";
myLabelContent[11] = "(l)";
myLabelContent[12] = "(m)";
myLabelContent[13] = "(n)";
myLabelContent[14] = "(o)";
myLabelContent[15] = "(p)";
myLabelContent[16] = "(q)";
myLabelContent[17] = "(r)";
myLabelContent[18] = "(s)";
myLabelContent[19] = "(t)";
myLabelContent[20] = "(u)";
myLabelContent[21] = "(v)";
myLabelContent[22] = "(w)";
myLabelContent[23] = "(x)";
myLabelContent[24] = "(y)";
myLabelContent[25] = "(z)";


var myContent = (0 + myLabelTotal)
for (i = 0; i < myTotalLayers;  i++)
{
	myLayer = myDocument.artLayers[i];
	myLayer.textItem.contents = myLabelContent[myContent];
	myLabelTotal = (myLabelTotal -2);
	myContent = (i+1) + myLabelTotal;
}	

myDocument.flatten();

Installing the script

Installing this script, or any Photoshop script is really easy. Just place the .js or .jsx file into the scripts folder within your Photoshop application folder. Such as, C:\Program Files\Adobe\Adobe Photoshop CS3\Presets\Scripts. You may need to restart the appliacation to see the script.

Download the LabelMaker Script


back to top

Image of a notepad

Script table-of-contents

Script files


Other Projects:

Adobe JavaScripts ↑↓

Adobe Creative Suite Tutorials ↑↓



Do you often need to make text labels for images?

Yes.
No.
I do now!