#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;
};