3 Replies Latest reply on Oct 23, 2009 10:22 PM by Techi Panda

    Grouping labeled textframes

    Techi Panda Level 2

      Hi scripters

       

      i cant group two labeled textframes, where i am wrong in the below script

       

      x = app.activeDocument.textFrames.item("Fig");
      y = app.activeDocument.textFrames.item("Cap");

      g = app.activeDocument.groups.add([x,y]);

       

      ERROR

      ---------------------------
      Adobe InDesign
      ---------------------------
      JavaScript Error!

      Error Number: 30477
      Error String: Invalid value for parameter 'groupItems' of event 'add'. Expected Array of PageItems, but received nothing.
      Line: 21
      Source: g = app.activeDocument.groups.add([x,y]);
      ---------------------------
      OK  
      ---------------------------

      thanks in advance

       

      regards

      a r u l

        • 1. Re: Grouping labeled textframes
          Laubender Adobe Community Professional & MVP

          Hi Arul!

          The error report states Line 21.

          You did not post the whole code. The 3 lines of code which are available work as expected. Tested this with CS3 and CS4. To investigate further we definitively need to see more code ;-) and/or a description of the InDesign text frames you‘re working with. Maybe one or all of the text frames you want to group are locked?

           

          Regards,

          Uwe Laubender

          • 2. Re: Grouping labeled textframes
            AdobeScripts Level 3

            x = app.activeDocument.textFrames.item("Fig");
            y = app.activeDocument.textFrames.item("Cap");

            g = app.activeDocument.groups.add([x,y]);

             

            ERROR

            ---------------------------
            Adobe InDesign
            ---------------------------
            JavaScript Error!

            Error Number: 30477
            Error String: Invalid value for parameter 'groupItems' of event 'add'. Expected Array of PageItems, but received nothing.
            Line: 21
            Source: g = app.activeDocument.groups.add([x,y]);

             

            are you sure that x and y "contains" TextFrames ?

            InDesign's message is clear - Expected Array of PageItems, but received nothing - x or y or both are "empty"

             

            robin

             

            www.adobescripts.co.uk

            1 person found this helpful
            • 3. Re: Grouping labeled textframes
              Techi Panda Level 2

              Hi rabin

               

              thanks for your suggestion i will try it

               

              thanks again

               

              regards

              a r u l