Highlighted

Update Text Insets in Doc

New Here ,
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

Adobe Community Professional
Correct answer by frameexpert | Adobe Community Professional

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

TOPICS
Scripting

Views

566

Likes

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

Update Text Insets in Doc

New Here ,
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

Adobe Community Professional
Correct answer by frameexpert | Adobe Community Professional

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

TOPICS
Scripting

Views

567

Likes

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
Nov 03, 2015 0
Contributor ,
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.

Likes

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
Reply
Loading...
Nov 04, 2015 0
Adobe Community Professional ,
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

Likes

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
Reply
Loading...
Nov 04, 2015 0
New Here ,
Nov 04, 2015

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Nov 04, 2015 0