Skip to main content
Known Participant
November 3, 2015
Answered

Update Text Insets in Doc

  • November 3, 2015
  • 2 replies
  • 904 views

Hi all,

Just wondering if anyone knows if there's a similar call to UpdateBook() for a doc? I'm looking to update the text insets within a document, but the FM documentation seems to be telling me this is only possible to do if the doc is stored in a book.

Thanks,

Carl

This topic has been closed for replies.
Correct answer frameexpert

You should be able to do something like this:

#target framemaker

var doc = app.ActiveDoc;

// Loop through the text insets in the document.

ti = doc.FirstTiInDoc;

while (ti.ObjectValid () === 1) {

    ti.UpdateTextInset (); // Update the inset.

    ti = ti.NextTiInDoc;

}

Rick

2 replies

frameexpert
Community Expert
frameexpertCommunity ExpertCorrect answer
Community Expert
November 4, 2015

You should be able to do something like this:

#target framemaker

var doc = app.ActiveDoc;

// Loop through the text insets in the document.

ti = doc.FirstTiInDoc;

while (ti.ObjectValid () === 1) {

    ti.UpdateTextInset (); // Update the inset.

    ti = ti.NextTiInDoc;

}

Rick

www.frameexpert.com
Known Participant
November 4, 2015

Excellent, thank you gentlemen! UpdateTextInset() is what I was looking for.

Participating Frequently
November 4, 2015

I've no experience of this, but there are some pointers to things that should work. I'm working from the C-library FDK. I believe I've correctly translated between its terminology and the ExtendScript terminology, but if you get problems, check the Scripting Guide for FrameMaker.

You can loop through the text insets in a document, calling UpdateTextInset() on each. This is what I would do.

You could instead try to update the text insets automatically when you open the file:

  • the document has a DontUpdateTextInsets property:
    • True if FrameMaker product doesn’t automatically update text insets when it opens the document
  • each text inset has a TiAutomaticUpdate property:
    • True if the inset is updated automatically.
    • TiAutomaticUpdate has no effect if the document’s DontUpdateTextInsets property is set to True
  • the openParams you can pass to Open() have an UpdateTextReferences property:
    • DoUserPreference: update text insets if the document property, DontUpdateTextInsets, is False.
    • DoYes: update text insets.
    • DoNo: don’t update text insets.