4 Replies Latest reply on Nov 13, 2012 1:00 PM by JJMack

    Method to select all "invisible" layers?

    Benji2008

      Hi there,

       

      Does anyone know if there is a plugin or a way to select all the invisible layers from a photoshop file autmatically with just one click?
      This would be really handy when it comes to huge photoshop files with lots of folders & layers...

       

      Screen shot 2012-11-12 at 15.22.36.png

       

      kind regards,

      Ben

        • 1. Re: Method to select all "invisible" layers?
          charles badland Level 4

          Not sure about targeting all hiden layers in one click, but you can filter so that just non visible layers are showing, then it is easy to target all.  (Under Layer Panel tab, choose Attribute and then Non Visible)

          Might be possible to write a script or record action to do same?

          • 2. Re: Method to select all "invisible" layers?
            Benji2008 Level 1

            excellent!

             

            Just what I was looking for!

             

            Thanks very much!

            • 3. Re: Method to select all "invisible" layers?
              charles badland Level 4

              You're welcome!

              And, I'm not sure why you want to target all hidden layers... but I assume you know in the Layer Menu there is a Delete all Hidden Layers command.

              • 4. Re: Method to select all "invisible" layers?
                JJMack Most Valuable Participant

                Filtering layer requires CS6 and requires more then one click. Creating a action that uses a script can be assigned to a key that only requires one key click...

                target_invisible_layer_or_layerset(activeDocument);
                
                function target_invisible_layer_or_layerset(ref) {
                          var layers = ref.layers;  
                          var len = layers.length; 
                          for ( var i = 0; i < len; i ++) { 
                                    var layer = layers[i];
                                    if (!layers[i].visible) { selectLayerByName(layer.name);}
                                    if (layer.typename == 'LayerSet') { target_invisible_layer_or_layerset(layer);}   
                          } 
                }
                
                function selectLayerByName(name){ 
                var idslct = charIDToTypeID( "slct" );
                    var desc10 = new ActionDescriptor();
                    var idnull = charIDToTypeID( "null" );
                        var ref8 = new ActionReference();
                        var idLyr = charIDToTypeID( "Lyr " );
                        ref8.putName( idLyr, name );
                    desc10.putReference( idnull, ref8 );
                    var idselectionModifier = stringIDToTypeID( "selectionModifier" );
                    var idselectionModifierType = stringIDToTypeID( "selectionModifierType" );
                    var idaddToSelection = stringIDToTypeID( "addToSelection" );
                    desc10.putEnumerated( idselectionModifier, idselectionModifierType, idaddToSelection );
                    var idMkVs = charIDToTypeID( "MkVs" );
                    desc10.putBoolean( idMkVs, false );
                    try{
                          executeAction( idslct, desc10, DialogModes.NO );
                          }
                    catch(e){}
                };