Thank you for the script. Much appreciated. I am, however getting an error:
Error 25: Expected: ;.
Line: 8
-> for(var a=0;a activeDocument.activeLayer
= activeDocument.Layers.getByName(doc.layerSets[a].name);
Any way to fix that or what am I doing wrong?