Illustrator Script - Change Stroke color in a specific layer
Hi there,
i try for just 4 hours now to get a function to change the stroke color of all objects in a layer "1".

with this script, every object is being recolored, this is working:
with (docRef) {
pathItems[h].strokeColor = newColor;
}
}
But if i only want to choose the pathItems in Layer "1", it doesn't work.
var ln = '1';
var ol = docRef.layers.getByName(ln);
for (var i = 0; i < ol.pathItems.length; i++) {
ol.pathItems[i].strokeColor = newColor;
}
I tried to lock the other layer and then to change color of all items, that are not locked. But didn't work either.
Where is my fault?
