Copy link to clipboard
Copied
How to get the stroke size of a shape layer in Photoshop? For example, if the current rectangle tool creates a shape layer with a stroke size of 30 pixels, how can I retrieve this information?
try {
// Works only in Photoshop CC
var the_layer = activeDocument.activeLayer;
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("AGMStrokeStyleInfo"));
r.putIdentifier(stringIDToTypeID("layer"), the_layer.id);
var ret = executeActionGet(r).getObjectValue(stringIDToTypeID("AGMStrokeStyleInfo")).getUnitDoubleValue(stringIDToTypeID("strokeStyleLineWidth"));
alert(ret);
} catch (e) { alert(e.line+ "\n\n" +e); }
Copy link to clipboard
Copied
try {
// Works only in Photoshop CC
var the_layer = activeDocument.activeLayer;
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("AGMStrokeStyleInfo"));
r.putIdentifier(stringIDToTypeID("layer"), the_layer.id);
var ret = executeActionGet(r).getObjectValue(stringIDToTypeID("AGMStrokeStyleInfo")).getUnitDoubleValue(stringIDToTypeID("strokeStyleLineWidth"));
alert(ret);
} catch (e) { alert(e.line+ "\n\n" +e); }
Copy link to clipboard
Copied
Thank you, you are really