Skip to main content
rarur97798982
Inspiring
April 10, 2018
Answered

Changing stroke weight

  • April 10, 2018
  • 1 reply
  • 2944 views

Hi,
I need to check the stroke weight of all elements in the active document whether it is below 2. And need to change those stroke weight to 2.
The problem is, I couldn't get how to change the stroke weight or how to check the stroke weight of any elements.

Thanks in advance.

This topic has been closed for replies.
Correct answer Doug A Roberts

OKay, I will do it from now onwards. Thankyou.


disclaimer: I'm not great at scripting, but something along these lines?

if ( app.documents.length > 0 && app.activeDocument.pathItems.length > 0 ) {

doc = app.activeDocument;

for (var i = 0; i < doc.pathItems.length; i++ ) {

pathRef = doc.pathItems;

if (pathRef.strokeWidth < 2)

{

pathRef.selected = true

pathRef.stroked = true

pathRef.strokeWidth = 2

}

}

}

1 reply

Monika Gause
Community Expert
Community Expert
April 10, 2018

You can do this with the magic wand tool.

Draw a line with a stroke width of 0.01 pt

Set the threshold in the magic wand to 0.18 pt

Click on your line with the magic wand tool.

rarur97798982
Inspiring
April 10, 2018

Thanks for the reply. But, actually I need scripts (javascript).

Monika Gause
Community Expert
Community Expert
April 10, 2018

You should somehow mention that in your question.