Copy link to clipboard
Copied
Is there a script or plug-in that would allow the selection of objects that are above or below a certain threshold for area size or path length?
For example, I want to select and delete all objects that have an area of less than 1 mm². Or a path length less than 1mm.
Or just select paths that are over 1000mm long or more than 1000 mm² in size?
(Running CC2017 / Mac)
You could try this
#target illustrator
// deletes pathItems smaller than the supplied length
var idoc = app.activeDocument;
var howLong = prompt ("Enter the size in points of small paths to be deleted", 2, "Delete Small Paths");
for (i=0 ; i< idoc.pathItems.length; i++)
{
var ipath = idoc.pathItems
if ( ipath.width < howLong && ipath.height < howLong)
{
ipath.selected = true;
}
}
app.redraw();
if(confirm ("Pro
...Copy link to clipboard
Copied
You could try this
#target illustrator
// deletes pathItems smaller than the supplied length
var idoc = app.activeDocument;
var howLong = prompt ("Enter the size in points of small paths to be deleted", 2, "Delete Small Paths");
for (i=0 ; i< idoc.pathItems.length; i++)
{
var ipath = idoc.pathItems
if ( ipath.width < howLong && ipath.height < howLong)
{
ipath.selected = true;
}
}
app.redraw();
if(confirm ("Proceed to delete selected items?", "yes", "Confirm Delete"))
{
app.cut();
}
Copy link to clipboard
Copied
This script has a bug -
var ipath = idoc.pathItems
should be
var ipath = idoc.pathItems[i];
Copy link to clipboard
Copied
all scripts got messed up when we migrated to the new Forums 😞