How to change the StrokeCap of all objects in a few layers
hello,everyone.
i want to change the strokeCap of all objects in a particular layer.
var document = app.activeDocument;
var allLayers = app.activeDocument.layers;
var testLayer = ["a", "b"];
function lineFormat(LayerName) {
//Select objects in layer
document.activeLayer = document.layers[LayerName];
//document.activeLayer.hasSelectedArtwork = true;
//Change Style
document.activeLayer.pathItems.stroked = true; // open stroke
document.activeLayer.pathItems.strokeCap = StrokeCap.BUTTENDCAP;//ROUNDENDCAP, PROJECTINGENDCAP
document.activeLayer.pathItems.strokeJoin = StrokeJoin.ROUNDENDJOIN;//BEVELENDJOIN, MITERENDJOIN
//Deselect objects in layer
//document.activeLayer.hasSelectedArtwork = false;
}
for (var i = 0, il = allLayers.length; i < il; i++) {
var curLayer = allLayers[i]
if (curLayer = testLayer[i]) {
//if layer name found
lineFormat(testLayer[i])
}
} then,i wrote the code as I understood it, but nothing happened to it for now, I don't know how to fix this code
Anyone can help me?
