Hello,
I'm looking to automate the deleting invisible layers weather they are in groups or locked,
I currently have an action that:
selects all layers,
runs a "lock layer" command with all the options unchecked to unlock every layer,
delete hidden layers.
it works fairly well but the problem is: if there is a locked group, the unlock all layers command doesn't work on it and it all fails.
is there a way to do this with actions?
and if not I've been trying to make a rudimentary script for it
so far I have this
for (i=app.activeDocument.layers.length; i>0; i--)
{
if(app.activeDocument.layers[i-1].allLocked) app.activeDocument.layers[i-1].allLocked = false;
if (!app.activeDocument.layers[i-1].visible) app.activeDocument.layers[i-1].remove();
}
the problem is again is it doesn't work for layers inside groups.
I've found this thread Delete all groups and layers that are switched off, even if they are locked
and the script in there crashes my photoshop.
any help would be very appreciated.