1 Reply Latest reply on Oct 6, 2009 3:58 AM by ramkumar.vp

    center text frame in frame

    Seth McGraw Level 1

      In CS & CS2 (javascript) I can't use menu actions to center content in a frame. I have a textbox that contains a paragraph that I want to place the textbox in a frame and center (both horizontal & vertical).

       

      Does anyone know how to do this?

       

      Thanks

        • 1. Re: center text frame in frame
          ramkumar.vp Level 3

          Hi Seth,


          After placing the inline text box, Select the outer/parent frame and run the following code:


          var myFrame = app.selection[0];
          var Len = myFrame.paragraphs.length-1;
          myFrame.textFramePreferences.verticalJustification = VerticalJustification.centerAlign;
          myFrame.paragraphs.itemByRange(0,Len).justification = Justification.centerAlign;

           

          I think this will solve your problem.


          Regards,

          Ramkumar