3 Replies Latest reply on May 11, 2011 10:36 PM by c.pfaffenbichler

    Move group Layers set

    sasientry Level 1

      // duplicate layersets to other file;
      // will not work if more than two files are open;
      // 2011; use it at your own risk;
      #target photoshop
      if (app.documents.length == 2) {
           var myDocument = app.activeDocument;
           if (myDocument != app.documents[1]) {var theOtherDoc = app.documents[1]}
           else {var theOtherDoc = app.documents[2]};
           for (var a = myDocument.layers.length - 1; a >= 0; a--) {
           var theLayer = myDocument.layers[a];
                if (theLayer.typename == "crop") {
                     theLayer.duplicate(theOtherDoc, ElementPlacement.PLACEATBEGINNING)
                     }
                }
           }
      else {alert ("more or less than than two documents are open; unclear about the target document")};

       

       

      This Script Not Working Please Help Me

        • 1. Re: Move group Layers set
          c.pfaffenbichler Level 9

          Where does this come from?

                    if (theLayer.typename == "crop") {

          What is typename »crop« supposed to be?

          • 2. Re: Move group Layers set
            sasientry Level 1

            // duplicate layersets to other file;
            // will not work if more than two files are open;
            // 2011; use it at your own risk;
            #target photoshop
            if (app.documents.length == 2) {
                 var myDocument = app.activeDocument;
                 if (myDocument != app.documents[1]) {var theOtherDoc = app.documents[1]}
                 else {var theOtherDoc = app.documents[2]};
                 for (var a = myDocument.layers.length - 1; a >= 0; a--) {
                 var theLayer = myDocument.layers[a];
                      if (theLayer.typename == "LayerSet") {
                           theLayer.duplicate(theOtherDoc, ElementPlacement.PLACEATBEGINNING)
                           }
                      }
                 }
            else {alert ("more or less than than two documents are open; unclear about the target document")};

             

            This Script Also Not worked please help me

             

            i give layer set name Group 1 how i can run

             

            how its identify document 1 and document 2

            • 3. Re: Move group Layers set
              c.pfaffenbichler Level 9
              i give layer set name Group 1 how i can run

              Please explain what you mean by this.

              If you want only a layerSet of a specific name copied you could set up an if-clause dependent on the layer’s name like

               if (theLayer.name == "Group 1") {