remove specific pathPoints from a polygon
Hi, I'm new here, sorry if this is a dumb question. I couldn't find it in any of the (rather scanty) documentation on InDesign scripting.
I have a closed polygon (single path) named myFS and want to remove 2 specific points ( (myleft,mybottom) and (myright, mybottom) ) from it. I know they're in there because of how I constructed the polygon. Apparently there's no remove method for pathPoints in InDesign (unlike Illustrator). So instead I'm trying to retain all the ones I want, and skip those I don't. Here's what I've tried. But I don't understand how Points are represented, I guess, because this doesn't work--it never finds the points I want, and so myNewFS is the same polygon as myFS.:
var myPathPoints = Array();
var myEntirePath = myFS.paths.item(0).entirePath;
for (i = 0; i< myEntirePath.length; i++) {
var myPoint = myEntirePath;
if (myPoint[0] == Array(myleft, mybottom) || myPoint == Array(myright, mybottom)){
continue; // skip the ones I want to remove
} else {
myPathPoints.push(myPoint);
}
}
var myNewFS=myDocument.polygons.add();
myNewFS.paths.item(0).entirePath = myPathPoints;
myNewFS.fillColor = myDocument.colors.item("RGB Yellow");
Thanks a lot in advance for your help!
Barbara