Finding and removing from a document a PathItems whose area is less than 50.0
Who can explain the incomprehensible behavior of the script. There are many PathItems in the scene. It is required to remove from the scene all PathItems whose area is less than 50.0.
-------------------------------------------------------------------------------
var aiDocument = app.activeDocument;
for (j = 0; j < aiDocument.layers.length; j++) {
var LocLayer = aiDocument.layers[j];
for (k = 0; k < LocLayer.pathItems.length; k++) {
if(LocLayer.pathItems[k].area <= 50.0){
LocLayer.pathItems[k].remove();
}
}
}
app.redraw();
-----------------------------------------------------------------------------------
After the script is executed, the part of the PathItems that meet this condition is removed, and the part remains in the document. And to completely remove such PathItems, you need to run this script several times.... ???
