Activate Layers from a specific folder
I need to create a function to turn on layers from an specific folder when button pressed.
Here is a screenshoot to make it more easy to understand it. 
Thanks in advance!
I need to create a function to turn on layers from an specific folder when button pressed.
Here is a screenshoot to make it more easy to understand it. 
Thanks in advance!
My original idea was to change active layer when clicking button (like the attached GIF). I need to create a simple avatar creator, so I will have multiple faces, ears, hairs, etc. It's my first time with PSD scripting. I don't know if it is a better solution for this. Thanks!

var set = activeDocument.layerSets.getByName("Head");
for (var i = 0; i < set.layers.length; i++) if (set.layers[i].visible) break;
i = (i+1) % set.layers.length;
for (var n = 0; n < set.layers.length; n++)
{
var viz = n==i;
if (set.layers[n].visible != viz) set.layers[n].visible = viz;
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.