3 Replies Latest reply on Dec 3, 2013 3:01 AM by Mi_D

    Select group with label

    przemek_macko Level 1

      hi, I try to select group on page

       

      var doc = app.activeDocument;

      var myModul = doc.groups.item("modul");

      //var myModul = doc.groups[0];

       

      //$.writeln("ID: "+myModul.id);

      $.writeln("Constructor: "+myModul.constructor.name);

      //$.writeln("typ: "+typeof(myModul));

      app.select(myModul);

       

      Why this doesn't work ?

        • 1. Re: Select group with label
          Mi_D Level 3

          try below code

           

           

          var doc = app.activeDocument;

          var myPage = doc.pages

          var myModul = doc.groups.item("modul");

          for(var i = 0;  myPage.length>i ;i++){

                var allItems =myPage[i].allPageItems

                 for(var j=0;j<allItems.length;j++)

                          {

                              var myGroup = allItems[j];

                                  if(myGroup.label =="modul"){

                                      $.writeln("Constructor: "+myGroup.constructor.name);

                                          app.select(myGroup);

                         }

                }

          }

          • 3. Re: Select group with label
            Mi_D Level 3

            if above code help full click yes " 

            " Was this helpful?  Yes    No  "

             

             

             

            1 person found this helpful