This is my first post on this forum. I need help with making a script that selects all the paths in a document that has a certain line width, for example 3 pt, and move them to a specific layer.
Since my knowledge of javascript is limited I would like to have an example in vb script.
With a few tweaks I managed to save a vbs script and it works perfectly!
Next step is to develop the script to create two layers for me, a thich and and a thin layer so I automaticly can seperate the line widths in my doucuments.
If I ran into problems I'm sure you guys here will here from me...
Here is the working vbs
Set appRef = CreateObject("Illustrator.Application")
Set idoc = appRef.ActiveDocument 'get active document Set ilayer = idoc.Layers("Thick") 'get specificLayer
ilayerzorder = idoc.Layers.Index(ilayer) 'get layer zOrder placement ilayer.ZOrder 4 'move to the bottom
For i = idoc.PathItems.Count To 1 Step -1 'loop thru all pathItems backwards Set ipath = idoc.PathItems(i) 'get path If ipath.StrokeWidth = 4.25 Then 'check for size ipath.Move ilayer, 1 'move to specificLayer if size = 3 points End If Next
'move layer back to its original position ilayer.Move idoc.Layers(ilayerzorder), 3