error while running script for multiple files
Hi All,
I have script for Spliting artboard layers. it works fine as a single file or multiple files. but if the file does not have that layer what i need to export. the script stops working. not move to verify another file stucks with the same file.
var names = ["Opaque White Layer", "Opaque White 2nd Layer", "Frosted White Layer"];
doesLayerExist(app.activeDocument.layers, names)
function doesLayerExist(layers, names) {
for (i=0; i<layers.length; i++) {
for (j=0; j<names.length; j++) {
if (layers.name==names
}
}
return false;
}
if there is no
["Opaque White Layer", "Opaque White 2nd Layer", "Frosted White Layer"];
the script fails to move to analyse next file.