3 Replies Latest reply on Mar 21, 2013 12:32 AM by BEGINNER_X

    Select all Linked Text Frames

    BEGINNER_X Level 3

      Dear All,

       

      My Request:

       

      1. Is it possible to select all linked text frames of my selecting text frame (Please refer attachment)

       

      2. Suppose If we select all text frames, is it possible to fix height for all text frames like as 3p or 4p etc....

       

       

      Trying script for select all linked text frames:

       

      if (app.selection[0].nextTextFrame == null)

      {

         if (app.selection[0].previousTextFrame != null)

         {

              alert("pass")

              app.select(previousTextFrame.parent) && app.select(nextTextFrame.parent) && app.select(startTextFrame.parent)

              }

              }

       

       

      Screen Shot 2013-03-19 at 8.01.03 PM.png

       

       

      Could you anyone give solution for my request.

       

      Thanks in advance

      Beginner

        • 1. Re: Select all Linked Text Frames
          BEGINNER_X Level 3

          Hi All,

           

          If I select any text frame, I need to select all linked text frames of selecting text frame.

           

          Please can anyone help me...

           

          Please refer the above screenshot for your reference.

           

           

          Trying script:

           

          if (app.selection[0].nextTextFrame == null)

          {

             if (app.selection[0].previousTextFrame != null)

             {

                myParagraphs = app.selection[0].parentStory.paragraphs;

                         

                for (j=0;j<myParagraphs.length;j++)

                 {

                  myParentTF = myParagraphs[j].parentTextFrames[0].contents

                  alert(myParentTF)

                  }

                  }

              }

           

          Output i needed:

           

          Screen Shot 2013-03-20 at 11.14.50 AM.png

           

           

          Thanks in advance

          BEGINNER

          • 2. Re: Select all Linked Text Frames
            MrTIFF Level 3

            If all you want to do is make the linked textFrames be all the same height, here's one way to do it:

             

            if (app.selection.length == 0) {

                      alert("please select a textFrame before running this script");

                      exit();

            }

            var mySelection = app.selection[0];

            if (!(mySelection instanceof TextFrame)) {

                      alert("Please select a TextFrame before running this script");

                      exit();

            }

            var myStory = mySelection.parentStory;

            var myFrames = myStory.textContainers;

            var nFrames = myFrames.length;

            for (var ix = 0; ix < nFrames; ix++) {

                      var myFrame = myFrames[ix];

                      var bounds = myFrame.geometricBounds;

                      bounds[2] = bounds[0] + 4;          // set the TextFrame to 4 units in height

                      myFrame.geometricBounds = bounds;

            }

             

            Stephen

            • 3. Re: Select all Linked Text Frames
              BEGINNER_X Level 3

              Thanks a lot Stephen!!!!!.

               

               

              Its working fine.