Center text frame in frame

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

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

Similar Messages

  • How to find a text in the Frame maker document via script?

    How to find a particular text in the Frame maker document via script?

    johnsyns wrote:
    Why it doesn't work for the other days? When i tried to change the days other than wednesday. it return nothing.
    Reason why Justin's code does not work for other days is date format mask DAY returns day blank padded to 9 characters which is the longest day name which, yes you guessed right, is WEDNESDAY. You either need to blank pad or use format modifier FM:
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'DAY') = 'TUESDAY'
      5  /
    no rows selected
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'DAY') = 'TUESDAY  '
      5  /
    DT
    07-APR-09
    14-APR-09
    21-APR-09
    28-APR-09
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'FMDAY') = 'TUESDAY'
      5  /
    DT
    07-APR-09
    14-APR-09
    21-APR-09
    28-APR-09
    SQL> SY.

  • Automatically reduce overset text in a frame?

    I am working with variable data, which pulls text from a spreadsheet. I know I can fit text to a frame, but I don't want to fill the frame. I need the text to start at a specific size, and then if it doesn't fit, reduce the size of the font. I am merging data, so when I print, the document should compose longer email address, or company names, smaller than the intended 10pt. typesize.
    We own a license for XMPie, but it really slow, not to mention expensive to upgrade (again) now that we've moved to Creative Cloud. There must be a way using a plugin, or writing some script. We produce thousands of mailing pieces for schools and non-profits, and I want to steer the company towards an Adobe workflow. We have access to the entire CC suite, so maybe InDesign isn't the solution.
    ? Scott

    I think my article may have been taken to imply that the solution fills the frame. That is not the case.
    The article does imply trying to fill a name badge, but the principle can work for what you are trying to do. The change to the character style doesn't have to be purely to the character height or width, but can change the point size of the type as well as its leading. Re-read the article but more importantly the user comments underneath the article and the solution for instances where there are lots of letters, rather than typing ....... over and over again, use the ^.{x,} where x represents the amount of letters to change.
    Colin

  • How to center text in shapes

    how to center text in shapes. specifically circles.  I want text to be centered directly in the middle

    A lot depends on what you mean by centered, the number of lines of text, the actual font, and whether there are descenders.
    Using vertical justification set to centered may or may not work for you, depending on the above factors, as it depends on the baseline, I believe, rather than the acutal glyph dimensions. You could try adding baseline shift, I suppose, to make fine vertical adjustments, or you can bite the bullet and use the old-fashioned method of two frames.

  • Center text in a text component with line wrapping

    I need to display dynamic text in a text component. I need line wrapping (on work boundaries) and also need horizontal and vertical center alignment.
    How do I do this? I saw a previous post on aligning text in a JTextArea that said to use a JTextPane but I don't see in JTextPane how to do word wrapping.
    Thanks,
    John

    //  File:          SystemInfoWindow.java.java
    //  Classes:     SystemInfoWindow
    //  Package:     utilities.msglib
    //  Purpose:     Implement the SystemInfoWindow class.
    //     Author:          JJB 
    //     Revision History:
    //     Date            By   Rel#  Description of change
    //     =============  ===  ====  ===============================================
    //     Jul 3, 2006   JJB  1.00  Original version
    //  Public Types / Classes          Type Description
    //  ========================     =============================================
    //     SystemInfoWindow
    package utilities.msglib;
    import java.awt.BorderLayout;
    import java.awt.Dimension;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JTextArea;
    import javax.swing.JTextPane;
    import javax.swing.SwingUtilities;
    * TODO Enter description
    class SystemInfoWindow extends JDialog {
          * @param args
         public static void main(String[] args) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        Test thisClass = new Test();
                        thisClass.setVisible(true);
                        SystemInfoWindow window = new SystemInfoWindow(thisClass);
                        window.setMessage("System shutdown in progress ... lot sof atatarte athis tis a sa logoint of tesxt it keeps going and going and going thsoreoiat afsjkjslakjs fshafhdskrjlkjsdfj");
                        window.setVisible(true);
         //     ------------------------  Inner Classes ---------------------
         static class Test extends JFrame {
              private JPanel jContentPane = null;
               * This is the default constructor
              public Test() {
                   super();
                   initialize();
               * This method initializes this
               * @return void
              private void initialize() {
                   this.setSize(300, 200);
                   this.setContentPane(getJContentPane());
                   this.setTitle("JFrame");
               * This method initializes jContentPane
               * @return javax.swing.JPanel
              private JPanel getJContentPane() {
                   if (jContentPane == null) {
                        jContentPane = new JPanel();
                        jContentPane.setLayout(new BorderLayout());
                   return jContentPane;
         //     ------------------------  Static Fields ---------------------
         private static final long serialVersionUID = -8602533190114692294L;
         //     ------------------------  Static Methods --------------------
         //     ------------------------  Public Fields ---------------------
         //     ------------------------  Non-Public Fields -----------------
         private JPanel jContentPane = null;
         private JTextPane textField = null;
         public SystemInfoWindow(JFrame frame) {
              super(frame);
              initialize();
              //setUndecorated(true);
              setLocationRelativeTo(frame);
              pack();
         //     ------------------------  Interface Implementations ---------
         //     ------------------------  Public Methods --------------------
         public void setMessage(String text){
              textField.setText(text);
              adjustSize();
         //     ------------------------  Non-Public Methods ----------------
         private void adjustSize(){
              Dimension oldSize = textField.getPreferredSize();
              textField.setPreferredSize(new Dimension(
                        oldSize.width, oldSize.height + 30));
              pack();
         //     ------------------------  Generated Code --------------------
          * This method initializes this
          * @return void
         private void initialize() {
              this.setSize(300, 200);
              this.setModal(true);
              this.setContentPane(getJContentPane());
              this.addWindowListener(new java.awt.event.WindowAdapter() {
                   public void windowOpened(java.awt.event.WindowEvent e) {
                        //setLocationRelativeTo(MsgLibGlobals.parent);
                        pack();
          * This method initializes jContentPane
          * @return javax.swing.JPanel
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   jContentPane = new JPanel();
                   jContentPane.setLayout(new BorderLayout());
                   jContentPane.setMaximumSize(new java.awt.Dimension(50,2147483647));
                   jContentPane.add(getTextField(), java.awt.BorderLayout.CENTER);
              return jContentPane;
          * This method initializes textField     
          * @return javax.swing.JTextPane     
         private JTextPane getTextField() {
              if (textField == null) {
                   textField = new JTextPane();
                   textField.setEditable(false);
                   textField.setMaximumSize(new java.awt.Dimension(20,2147483647));
              return textField;
    }Message was edited by:
    BaltimoreJohn

  • Trying to center text in a text box

    I have just upgraded from InDesign CS2 to CS4. I am trying to center text vertically in a text box. I remember in CS2 that there were three different buttons, one that would center it at the top, one that would center the text in the middle and one on the bottom.
    If anyone knows where these buttons went, it is much appreciated.
    Thanks.

    Ah! There they are...on the control panel, (when the frame is selected with the pick tool...as opposed to having a live insertion point). They are pretty far to the right. If your display size is such that not all the features fit, they may be getting clipped.

  • Vertically center text on a page-document wide

    Anyone know how to center text vertically on FrameMaker pages? (There is a way to do this, right?)
    Thanks!

    Nope, not document wide. You could do it manually on a page by page basis or if the content is suffciently small that you can make each page a fixed height row of a table you could use the Table middle setting for the paragraphs.
    With a tool like Framescript, you could set up a procedure that would determine the bottom gap from the last line of text to the end of the text frame and then split difference to push down the top of line text, but this requires a bit of coding.

  • How to set Value from Frame to Frame

    I am having 2 Frame. Frame A and Frame B. Frame A is having a text Field and a button. When i click on the button on the Frame A, how can pass the value inside the text field of Frame A into a text Field of Frame B which already prepared. Please help !

    Hi,
    Seems like u r not really undertand my real problem. Below is the details of my probelm.
    I have two JFrames in my application . From the first frame when
    I click the "Find" Button the second frame is instantiated which
    queries for the value to be found . My intention is that when I
    click find on the second Frame all other Column values(from the
    database) should be dispalyed in the First frame corresponding
    to the value I am searching. I am calling the set method in the
    first frame from the second frame to dispaly the values in the
    first frame. But this is not getting displayed in the first
    frame even though i am able to get the result printed in the
    console window.
    Hope you can be more understand and help me to solve the problem.

  • Frame in frame with graphics problem-or maybe not

    Hi from Croatia.
    Well I have and extremely demanding costumer that wants to control every single bit of the project.
    The problem is as follows.
    I have a book that every once in a wile has annotation which above and bellow has a graphic line (not simple line but complex graphic imported from illustrator.)
    I tried to anchor one object above and another bellow this text which lets say stands in the middle of text frame and for me everything works ok.
    But this demanding customer wants that those annotations are in separate frame so that he can have full control over them(?).
    So I made frame in frame-put wrapping around this smaller frame.
    The problem is- is it possible to put those graphics in this smaller frame, create text object and add it to library so that i can use it multiple times. I have more than hundred of those annotations.
    And is it possible when i cut the text from this main frame to paste it in this smaller one and that this small frame automatically fills with text so that frame expands vertically according with amount of text. I am not placing text but pasting. I hope you have understood but in every case here is an example.
    Main text frame(text fills full width of page)
    sadbhjasdsdab
    sagsafgsfgafsd
    agsfgfasg
    (Now smaller frame with graphic fills full width of main frame)
    ewfewtf
    agasg
    sdagasdga
    (text fom main frame continues)
    fasdfs
    dsgasgasg
    dfgdfsg
    dfsgsd
    Uf this was exhausting even for me.
    THX for any help.

    I tried to use 3 row table with header and footer, but the problem is that indesign does not allow tables to break when the part of table goes to another page.
    And THX for in for on those plugins.

  • Variables - Passing from frame to frame

    Hello,
    I am wondering if anyone can help me, and what I need to do
    is even possible :S
    I have a simple flash document where all the code is running
    in frames on the timeline, not the most efficient way I know, but
    it is sufficient for what I need to do in this case :D
    I have an input field on the first frame and the user puts
    their name in, this then gets passed to a variable named
    "forename". The thing I need to do is pass that variable onto the
    next frame to input into a dynamic text field.
    I have put the code off the first frame below to try and
    explain better.
    var forename:String = "";
    forename = forename_txt.text;
    So I need to take the forename and put it into a text field
    on the next frame. However at present flash throws an error up, in
    the past I would have solved this using a _global variable, but
    this no longer exists in action script 3.0 does it??
    Many thanks for any help, it is greatfully recieved.
    Kind regards
    Jude

    If you declare a variable on the first frame of the timeline,
    you should be able to access it no matter what frame you are on.
    //FRAME 1
    var forename:String = "";
    btn.addEventListener(MouseEvent.CLICK, nextFunc);
    function nextFunc (ev:MouseEvent):void {
    btn.removeEventListener(MouseEvent.CLICK, nextFunc);
    forename = forename_txt.text;
    gotoAndStop(2);
    //FRAME 2
    trace(forename); //outputs the text that was in
    forename_txt

  • Frame-by-Frame Animations

    hi guys!
    i really need help as soon as possible. i am currently
    constructing a frame-by-frame movie containing different still
    picture sequences with background music. my problem is, i have a
    deadline in a week, and, well, i am half-way done. but that's not
    the problem. it's that whenever i test my movie by publishing it,
    as soon as the pictures come out, the entire picture just turns
    red. then the pictures never come back. no matter how i publish it
    and no matter what format, it turns red. there are a few animations
    before that, like blinking lights and tweened texts, but those
    don't turn red. i don't know ho to fix this and i don't know what's
    going on... do you think it's just my computer?
    help!!!!
    -OriO-

    Hi,
    This miskate happens to me when I break apart an image and I
    delete the
    unused item from the library. Do you do so?
    Otherwise, I agree with Wolf Van Ween it may be a bug in
    Flash or at least
    your file.
    Hope this help..
    Yours,
    Rafiq R. Elmansy
    Multimedia Graphic Designer
    Macromedia Certified Proffessional
    www.beedesignstudio.com
    www.macromedia-review.blogspot.com
    www.mmug-egypt.mxdj.com
    "OriO_CheezecaKe" <[email protected]> wrote
    in message
    news:e1vi1g$2lf$[email protected]..
    > hi guys!
    >
    > i really need help as soon as possible. i am currently
    constructing a
    > frame-by-frame movie containing different still picture
    sequences with
    > background music. my problem is, i have a deadline in a
    week, and, well, i
    am
    > half-way done. but that's not the problem. it's that
    whenever i test my
    movie
    > by publishing it, as soon as the pictures come out, the
    entire picture
    just
    > turns red. then the pictures never come back. no matter
    how i publish it
    and no
    > matter what format, it turns red. there are a few
    animations before that,
    like
    > blinking lights and tweened texts, but those don't turn
    red. i don't know
    ho to
    > fix this and i don't know what's going on... do you
    think it's just my
    computer?
    >
    > help!!!!
    >
    > -OriO-
    >
    >

  • How do I go frame to frame after a few seconds?

    Hello,
    I'm new here so forgive any mistakes or lack of knowledge.
    (Brief history: I have programmed in Pascal before, currently learning Java and Flash)
    So my question is i want to be able to move from frame to frame after X amount of seconds. I have searched online for coding on how to do this with the action script and managed to get the first frame working. The problem occurs with my 5th frame as frame 1 goes to frame 5 in 5 seconds but when i want frame 5 to go to frame 10 in 10 seconds it decides not to work.
    Below is the code i used in order to accomplish the first frame:
    stop();
    var myTimer:Timer = new Timer(5000, 1);
              myTimer.start();
        myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, function(e:TimerEvent)
            play();
    If there is a problem with the code or if there is an alternative way for better practice please do let me know.
    My 5th frame code:
    stop();
    var myTimer2:Timer = new Timer(5000, 1);
      myTimer2.start();
        myTimer2.addEventListener(TimerEvent.TIMER_COMPLETE, function(e:TimerEvent)
            play();
    Thanks in advance. If anyone is struggling to understand my question, apologies because i am really bad when it comes to structuring sentences.

    You should not have to create more than one timer for this.  Also, you should not be building the event handler function into the listener, keep it as a separate function.
    In frame 1 you could have...
         stop();
         var myTimer:Timer = new Timer(5000, 1);
         myTimer.start();
         myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, moveOn);
         function moveOn(e:TimerEvent):void {
               play();
    and all you would need in frame 5 would be....
         stop();
         myTimer.start();

  • Hello, 2 questionss here is it possible or is there a way to convert all object s outlines in all frames to fills at once and not frame by frame? and why sometimes erases the outline instead of converting it to fill?

    Hello, 2 questionss here>is it possible or is there a way to convert all object s outlines in all frames to fills at once and not frame by frame? and why sometimes erases the outline instead of converting it to fill?

    Hello, 2 questionss here>is it possible or is there a way to convert all object s outlines in all frames to fills at once and not frame by frame? and why sometimes erases the outline instead of converting it to fill?

  • HELP!  How can I view a clip frame by frame in final cut pro?

    Hi, does anyone out there know how to view a clip in final cut pro frame by frame. I don't really want to use the jogging function as you cannot see each individual frame just all the frames snapped together. Any help would be much appreciated. Thanks.

    http://discussions.apple.com/thread.jspa?threadID=1304742&tstart=0
    It is really time to open the manuals, do the tutorials, and learn the basics of how this application works. You'll be amazed at what you learn it can do!
    Shane

  • Vertically Center Text in a Text Box

    Just switched form Acrobt 6 to Acrobat Pro 9 and can't figure out how to verically center text in a text box.  When I select the text it gives me the properties bar shown below:
    Seems like a really dumb question because I know I could in Acrobat 6 and I don't know why they would take away that feature, but I can't find it anwywhere.

    The only time the More button is enabled is when I have the Text Box selected, and then the options pertain to the line weight, etc. of the box and not the text.  When I select the text the More button is not enabled and the only options properties are the ones shown above.
    I made the Text Box by going to "Tools", "Comment & Markup", "Text Box Tool".  I have not seen anything that says Multiline and when I searched help it only talked about multiline fields in forms.
    Thanks for the quick responses.

Maybe you are looking for