Windows 7 / FM 11 / ESTK CS6 / ExtendScript 4.2.12
I am trying to perform a pretty simple task--iterating over the docs in a FrameMaker book and converting all text inset instances to their pathnames--but it won't allow me to access the text inset objects using FirstTiInDoc and NextTiInDoc.
For example, the code snippet is:
var book = app.ActiveBook;
var doc = book.FirstComponentInBook;
while (doc.ObjectValid())
{
var inset = doc.FirstTiInBook;
while (inset.ObjectValid())
{ /*inset processing*/
inset = inset.NextTiInBook;
}
doc = doc.NextBookComponentInDFSOrder;
}
I *know* there are text insets in the documents, a combination of external FM files and plain ANSI text files, all sourced and resolvable without issues. But ExtendScript just isn't assigning the Text Inset objects from .FirstTiInBook. It also throws an exception if I try to use ObjectValid() on an undefined variable (this might be the correct behaviour, please let me know if it is).
Am I using FirstTiInBook wrong somehow? The above snippet is lifted almost verbatim from Adobe script examples.
Many thanks,
JR