Copy link to clipboard
Copied
Hello all,
I am trying to use the Update References function of FM9 to update text insets, but somehow FM feels that nothing needs to be updated.There is no difference for text insets marked for manual or automatic updating. When I select the text inset and click the Update button in the Text Inset Properties it does re-read the source file. I am trying to use this feature to allow the use of standard texts in multiple documents and across many languages, without reverting to scripts. Obviously, the standard texts may or may not have changed, but I need FM to read them in again.
1. How does FM determine whether or not a text inset must be read in from the source file again ?
2. How can I force FM to read the text inset sources for the entire document ?
Thanks a lot for any insight in this matter
Jang
Copy link to clipboard
Copied
Jang,
for each TiFlow object FrameMaker stores properties, like .LastUpdate and .TiFileModDate. The first one seems to be key, as the FDK Reference says this:
F_ApiUpdateTextInset()
Updates the contents of a stale text inset. It determines whether an inset is stale by comparing the inset’s FP_LastUpdate property with the modification date of the inset’s source file.
F_ApiUpdateTextInset() does not update a text inset unless it is stale. To make a text inset stale, set its FP_LastUpdate property to 0.
So you can either »touch« the external files to change their last modification date or do what the FDK Ref tells you. In both cases you are back to scripting... which should be quite simple with FrameScript.
- Michael
Copy link to clipboard
Copied
Hello Michael,
This is more or less what I was afraid of. It would have been nice if FM had the decency of doing what you tell it to: with the Update References dialog showing the option to update automatic text insets you would expect it would just update them, not check whether FM feels it is necessary. Touching the external files may have all kinds of nasty effects on automatic backups, versioning etc. I don't want to change anything to those inset sources, as they are standard and should remain untouched / unchanged. So it looks like I will need to create a script to do what I feel FM should allow me to do. Oh well, it does make us FM pros a living, doesn't it ?
Thanks for the quick and clear answer.
Jang
Copy link to clipboard
Copied
Hi Michael,
Is there a representation of F_ApiUpdateTextInset() in FrameScript? I couldn't find
any. I remember that you recommended a while back to delete and import the text inset
in FrameScript to force an update. Is this still true?
Best regards
Winfried
Copy link to clipboard
Copied
Winfried,
Yes there is, I don’t remember when it was introduced:
Update TextInset(textinsetvar);
The reference continues:
»You must supply the text inset object variable for this command. You can also specify a document object and it will update all the automatic text insets in the document.«
- Michael
Copy link to clipboard
Copied
Hi Michael,
Now I checked our conversion back in 2008. I had used this command already, unfortunately it has a bug. When you update two text insets in the same text flow or in different text flows FrameMaker will crash with the second text inset. (I did not test text insets inside of other text insets.)
I downloaded the latest FrameScript version p245 for FrameMaker 8 and tested it again. When this command is executed the second time, FrameMaker still crashes.
Best regards
Winfried
Copy link to clipboard
Copied
I had one crash in FM9 when I included the Update TextInset command inside the loop that takes me through all text insets in the document. I guess it was pretty lethal for FM to update the textinset while the object pointing to that textinset was still being used inside the script. I then moved the Update command beyond the end of the loop and that works fine. There were no nested text insets in my source document, so I have not tried that either. But messing around with the textinset while at the same time relying on the objects pointing to the correct stuff inside the doc might not be too wise. Of course I don't know how Winfried's scripts are organized and I have not tried my script in FM8.
Ciao
Jang
Copy link to clipboard
Copied
Hi Michael,
Thanks to your infos, my first ever FrameScript works beautifully, including the Update TextInset (ActiveDoc) at the end. My customer is already excited about the number of hours this is going to save them on manually re-importing the text insets for each of their 15 target languages. I wish all the consulting jobs were so easy !!!
Ciao
Jang