4 Replies Latest reply on Dec 7, 2014 9:20 PM by selvam214

    Can't ungroup

    selvam214 Level 1

      Hi,

      I trying to ungroup the page items, the error displayed as per below, some hidden frames also displayed.

       

      What is this (Brown frame), and guide to me.

       

      Screen shot 2014-12-05 at 7.45.45 PM.png

       

      Code here:

       

       

      var myPages = app.activeDocument.pages;

      for(i=0; i<myPages.length; i++)

      {

         var mySelection = app.select(app.activeDocument.pages.item(i).allPageItems)

         var mSel = app.selection;

       

      app.activeDocument.groups.add(mSel)

       

          }

        • 1. Re: Can't ungroup
          selvam214 Level 1

          Sorry,

          I trying to group all page items.

          • 2. Re: Re: Can't ungroup
            Laubender Adobe Community Professional & MVP

            @selvam214 – when looking at your screenshot you are selecting objects that cannot be part of one group.

            You cannot group anchored pageItems, nested graphics and "regular" pageItems to one group. And allPageItems will give you too much objects.

             

            Another thing would be: You should add the group to a specific page.

            Not just add the group to the document.

             

            And you will have issues with locked page items…

             

            //Locked pageItems could prevent items from beeing grouped.
            //So we have to unlock all pageItems:
            app.activeDocument.pageItems.everyItem().locked = false;
            
            var myPages = app.activeDocument.pages;
            
            for(i=0; i<myPages.length; i++){
            
                //If there are no pageItems on a page, you cannot add a group.
                //If there is only one pageItem on a page, you cannot add a group.
            
                if(myPages[i].pageItems.everyItem().getElements().length > 1){
                    myPages[i].groups.add(myPages[i].pageItems.everyItem().getElements());
                    };
            
            };
            

             

            Uwe

            • 3. Re: Can't ungroup
              Laubender Adobe Community Professional & MVP

              And about the "brown" frame:
              It is the graphic that sits inside a rectangle.

               

              Uwe

              • 4. Re: Re: Can't ungroup
                selvam214 Level 1

                Hi Uwe,

                Thank you so much for this.

                 

                Selvam