1 Reply Latest reply on Feb 26, 2015 11:23 PM by Chinnadk

    Resizing TextFrame Centre Position

    Murali_Vetha Level 1

      Hi All,

       

      I need to increase all specified text frame (50mm x 100 mm) height vertically in centre position. If my Textframe height is 100mm then now I increase 100+50mm. In that 50 mm(Top is 25 and bottom is 25 mm). Please advice and also see my incomplete coding.

       

      var myframe = app.activeDocument.textFrames.everyItem().getElements();
      
      
      for (i=0; i < myframe.length; i++)
      {
      if (myframe[i].geometricBounds == 0, 1, 100, 50)
        {
              myframe[i].geometricBounds = 0, 1, 150, 50;
              }
      }
      alert ("Done")
      
      
      "
      
      

       

      Regards,

      Vetha

        • 1. Re: Resizing TextFrame Centre Position
          Chinnadk Level 4

          Hi Vetha,

           

          Try this,

           

          var myframe = app.activeDocument.textFrames.everyItem().getElements(); 

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

                  var myframheight = myframe[i].geometricBounds[2] - myframe[i].geometricBounds[0];

                  if (myframheight == 100) 

                  { 

                          myframe[i].geometricBounds = [0-25, 1, 100+25, 50]

                      } 

              } 

          alert ("Done") 

           

          Regards,

          Chinna