Answered
how to make alert for circle shape
i know how to get kind of solid layer
if(_layers[i].kind == LayerKind.SOLIDFILL){
alert("rectangle");
}
but what`s the kind of ellipse (circle shape) i need to make it in alert and thanks for you
i know how to get kind of solid layer
if(_layers[i].kind == LayerKind.SOLIDFILL){
alert("rectangle");
}
but what`s the kind of ellipse (circle shape) i need to make it in alert and thanks for you
This script will test to see if the first anchor point is a corner or rounded, so it will tell if the shapes are possibly a rectangle or an ellipse.
#target photoshop
var doc = activeDocument;
var layPath = doc.pathItems[0].subPathItems[0];
$.writeln(layPath.pathPoints[0].anchor+'===='+layPath.pathPoints[0].leftDirection)
if((layPath.pathPoints[0].anchor[0]===layPath.pathPoints[0].leftDirection[0])&&(layPath.pathPoints[0].anchor[1]===layPath.pathPoints[0].leftDirection[1])){
alert('Shape could be rectangle')
}
else{alert('Shape could be an ellipse')}Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.