What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Count tool - how to save the numbers in the output image


Gustav Mahler

New Member
Messages
2
Likes
0
Dear Sirs,

I am using the count tool in Photoshop CS5.1.
I managed to custom the dots and numbers (fond size and color) on screen, but I would like such numbers to appear in my output PNG picture as well. How can I do that?

Thank you very much in advance!

gm
 

Paul MR

The Script Master
Messages
382
Likes
206
One way is to create a text layer for each count, here is a Photoshop script that will do this....
You mighthave to ament the font size/colour to suit.
N.B. Create all your counts before running the script.

Code:
#target photoshop;
main();
function main(){
var ref = new ActionReference();
ref.putProperty(charIDToTypeID('Prpr'),stringIDToTypeID("countClass"));
ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") ); 
var Count = executeActionGet(ref).getList(stringIDToTypeID("countClass")).count
for(var z =0; z < Count; z++){
var X = executeActionGet(ref).getList(stringIDToTypeID("countClass")).getObjectValue(z).getUnitDoubleValue(stringIDToTypeID( "x" ));
var Y = executeActionGet(ref).getList(stringIDToTypeID("countClass")).getObjectValue(z).getUnitDoubleValue(stringIDToTypeID( "y" ));
var layerName = "Count " + (z+1);
createXY(layerName,X,Y,z); 
}
};
function createXY(layerName,X,Y,z) {  
var startRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var thisLayer = activeDocument.artLayers.add(); 
thisLayer.kind = LayerKind.TEXT; 
thisLayer.name = layerName; 
var textProperty = thisLayer.textItem; 
textProperty.kind = TextType.POINTTEXT;
//Font Size
textProperty.size = 72; 
textProperty.font = "Arial"; 
var newColor = new SolidColor(); 
//Font Colour
newColor.rgb.red = 19; 
newColor.rgb.green = 246; 
newColor.rgb.blue = 179; 
textProperty.color = newColor; 
textProperty.position = new Array( X,Y); 
thisLayer.blendMode = BlendMode.NORMAL; 
thisLayer.opacity = 100; 
textProperty.contents = "."+(z+1); 
app.preferences.rulerUnits=startRulerUnits;
};
 
Last edited:

Gustav Mahler

New Member
Messages
2
Likes
0
One way is to create a text layer for each count, here is a Photoshop script that will do this....
You mighthave to ament the font size/colour to suit.
N.B. Create all your counts before running the script.

Thank you so much!!!
It works perfectly.
 

Top