Alt/Option + layer eye clicking functionality inside a layer group only

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Kukurykus, Tom, xbytor

Posts: 14
Joined: Sun Nov 27, 2016 5:34 am
Location: EU

Alt/Option + layer eye clicking functionality inside a layer group only

Post by skrippy »

When we Alt/Option click the eye on a layer, we see this layer only.

I wish PS had native functionality to do this inside a layer group only, keeping what was visible outside of it untouched. This way you can switch between, for example, variations you made inside a layer group (and not needing Layer Comps). Ctrl+Alt/Option + eye click for example. I don't think it has?

The simplest alternative I'm envisioning is a hotkey to a script that cycles through the first level of layers inside a layer group and makes visible *only* the next layer each time.

For example, I would want to cycle through these 4 variations (inside the group only showing that layer) with a hotkey...


Some may want forward and backward, and/or starting from an already selected layer, but if it comes down to me I have to start even simpler, like starting on the first layer and somehow selecting the next layer on each script activation... :mrgreen:

My first questions are if this has already been solved before? Or if anyone feels it so useful they might wanna whip it up? :oops:

Otherwise I will someday dig into it and I would welcome key script bits, or clever ways you would go about it :idea:

Pseudo code for my ideal script (that would start by showing a possibly already selected layer only, then the next, etc., and also cycle) ...

Code: Select all

If ( (a layer group is selected OR the curent selection is inside a layer group) AND in this group more than one layer exists)

If (a layer inside the group is active) {

save its index

Make all layers inside this group invisible

Make the layer visible again that we saved.

} Else {

make visible the first layer only


This pseudo code is still lacking the clever bits to go to the next layer on each script activation, and to keep cycling...

TIA for any pointers :)