How can i get color of current rectangle and radius in alert
I`m working in scipt and i need to help me to get color of current rectangle shape in alert with corner radius ( size) px ..and thanks alot for you
I`m working in scipt and i need to help me to get color of current rectangle shape in alert with corner radius ( size) px ..and thanks alot for you
If I understand correctly, you can try (CC2018+)
try {
var layer = activeDocument.activeLayer;
var r = new ActionReference();
r.putIdentifier(stringIDToTypeID("layer"), layer.id);
var d = executeActionGet(r);
var col = d.getList(stringIDToTypeID("adjustment")).getObjectValue(0).getObjectValue(stringIDToTypeID("color"));
var rad = d.getList(stringIDToTypeID("keyOriginType")).getObjectValue(0).getObjectValue(stringIDToTypeID("keyOriginRRectRadii"));
var r = Math.round(col.getDouble(stringIDToTypeID("red")));
var g = Math.round(col.getDouble(stringIDToTypeID("green")));
var b = Math.round(col.getDouble(stringIDToTypeID("blue")));
var tr = rad.getUnitDoubleValue(stringIDToTypeID("topRight"));
var tl = rad.getUnitDoubleValue(stringIDToTypeID("topLeft"));
var bl = rad.getUnitDoubleValue(stringIDToTypeID("bottomLeft"));
var br = rad.getUnitDoubleValue(stringIDToTypeID("bottomRight"));
alert("RGB: " + r + "," + g + "," + b + "\n\n" + "Radii: " + tl + "," + tr + "," + br + "," + bl);
} catch(e) { alert(e); }
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.