Skip to main content
June 5, 2011
Answered

how to select paths with the same stroke width

  • June 5, 2011
  • 1 reply
  • 1727 views

I would like to know how to select all the paths inside a document whose stroke width are equal to 0.361 points

I will appreciate any help.

This topic has been closed for replies.
Correct answer CarlosCanto

here you go

#target illustrator

// script.name = selectPathsThisSize.jsx;

// script.description = selects pathItems that have the same supplied stroke width; limited to 3 decimals;

// script.required = a document with at least one path item;

// script.parent = CarlosCanto // 6/5/11;

// script.elegant = false;

var idoc = app.activeDocument;

var strokewidth = prompt ("Enter Stroke Width in points of paths to be selected", 0.361, "Select Paths this size:___");

for (i=0 ; i< idoc.pathItems.length; i++)

     {

          var ipath = idoc.pathItems;

               if ( (ipath.strokeWidth).toFixed(3) == Number(strokewidth).toFixed(3))

                    {

                         ipath.selected = true;

                    }

     }

app.redraw();

1 reply

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
June 5, 2011

here you go

#target illustrator

// script.name = selectPathsThisSize.jsx;

// script.description = selects pathItems that have the same supplied stroke width; limited to 3 decimals;

// script.required = a document with at least one path item;

// script.parent = CarlosCanto // 6/5/11;

// script.elegant = false;

var idoc = app.activeDocument;

var strokewidth = prompt ("Enter Stroke Width in points of paths to be selected", 0.361, "Select Paths this size:___");

for (i=0 ; i< idoc.pathItems.length; i++)

     {

          var ipath = idoc.pathItems;

               if ( (ipath.strokeWidth).toFixed(3) == Number(strokewidth).toFixed(3))

                    {

                         ipath.selected = true;

                    }

     }

app.redraw();

June 7, 2011

Carlos,

Thanks a lot. Your answer was perfect.

canserra