• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Update Text Insets in Doc

Community Beginner ,
Nov 03, 2015 Nov 03, 2015

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

712

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 04, 2015 Nov 04, 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

Votes

Translate

Translate
Contributor ,
Nov 04, 2015 Nov 04, 2015

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 04, 2015 Nov 04, 2015

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 04, 2015 Nov 04, 2015

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines