Answered
Differentiating PathText shape
How can we differentiate the PathText as an ellipse or a rectangle by using a script?
How can we differentiate the PathText as an ellipse or a rectangle by using a script?
// select areaText or pathText textFrame
var Ps = app.selection[0].textPath.pathPoints;
var polygon = true;
for (var i = 0; i < Ps.length; i++) {
var test = Ps[i].anchor[0] == Ps[i].rightDirection[0] &&
Ps[i].rightDirection[0] == Ps[i].leftDirection[0] &&
Ps[i].anchor[1] == Ps[i].rightDirection[1] &&
Ps[i].rightDirection[1] == Ps[i].leftDirection[1];
if (!test) {
polygon = test;
break;
}
}
if (polygon) alert("polygon");
if (!polygon) alert("non-polygon");Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.