Skip navigation
Currently Being Moderated

Precisely aligning anchored frames

Sep 26, 2011 1:49 PM

Using FM10 in TCS3 on Windows XP

 

Just finished watching Rick Quatro's webinar on ExtendScript.  One of the sample scripts changes the alignment of anchored frames to left, center, or right.  Is there any way to more precisely align the anchored frames using inches or pixels or whtaever?

 

As always, thanks in advance.

 
Replies
  • Currently Being Moderated
    Sep 26, 2011 2:14 PM   in reply to cvgs

    Everything that can be done to align an anchored frame using Frame's user interface can also be done via ExtendScript.

     

    Open the ExtendScript ToolKit and take a look at the AFrame class in the Object Model Viewer. You will see the Properties and Methods that are available. It's getting late here but I may be able to write a small example script tomorrow.

     

    Ian

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 27, 2011 2:41 AM   in reply to cvgs

    Setting the positioning of an anchored frame is one of the easier procedures with ExtendScript, but there are limitations...

     

    Assign the anchored frame to a variable named anchoredFrame, I won't go into the method of selection here.

     

    To select the Anchoring Position use the following:

     

    anchoredFrame.AnchorType = Constants.FV_ANCHOR_INLINE;

     

    The other possible anchoring poitions are:

     

    Constants.FV_ANCHOR_TOP

    Constants.FV_ANCHOR_BELOW

    Constants.FV_ANCHOR_BOTTOM

    Constants.FV_ANCHOR_SUBCOL_LEFT

    Constants.FV_ANCHOR_SUBCOL_RIGHT

    Constants.FV_ANCHOR_SUBCOL_NEAREST

    Constants.FV_ANCHOR_SUBCOL_FARTHEST

    Constants.FV_ANCHOR_SUBCOL_INSIDE

    Constants.FV_ANCHOR_SUBCOL_OUTSIDE

    Constants.FV_ANCHOR_TEXTFRAME_LEFT

    Constants.FV_ANCHOR_TEXTFRAME_RIGHT

    Constants.FV_ANCHOR_TEXTFRAME_NEAREST

    Constants.FV_ANCHOR_TEXTFRAME_FARTHEST

    Constants.FV_ANCHOR_TEXTFRAME_INSIDE

    Constants.FV_ANCHOR_TEXTFRAME_OUTSIDE

    Constants.FV_ANCHOR_RUN_INTO_PARAGRAPH

     

    Now that the anchoring position has been set, you can adjust the relevant positions just as you would with the user interface. The relevant properties are:

     

    anchoredFrame.BaselineOffset

    anchoredFrame.SideOffset

     

    These two properties look useful, but they seem to be read only for anchored frames:

    anchoredFrame.LocX

    anchoredFrame.LocY

     

    So, if you want to have more control over the horizontal positioning with the anchoring position set to Below Current Line (Constants.FV_ANCHOR_BELOW) you are probably out of luck - it can't be done using the user interface. In this case the best way would perhaps be to adjust the Anchored frame to match the column width then shift its entire contents to the required position. Perhaps someone knows a better way?

     

    Ian

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points