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
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
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:
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
Copy link to clipboard
Copied
Excellent, thank you gentlemen! UpdateTextInset() is what I was looking for.