Skip to main content
Jacob_AA
Known Participant
Jan 8, 2019 10:59 AM UTC
Question

Does anybody know how to update cross-references with ExtendScript

Does anybody know how to update ?

This topic is closed to new replies. Start a new post to keep the conversation going.

8 replies

Jacob_AA
Jacob_AAAuthor
Known Participant
Jan 8, 2019 12:07 PM UTC

Thanks, but it didn't help me. Maybe, I will need to go through each cross reference and update individually as I do it manually ? 

Translate
4everJang
Legend
Jan 8, 2019 12:11 PM UTC

Updating everything does not make a difference here, and may cause serious delays as FM opens and closes all kinds of files in the background.

I have found the UpdateXRefs method to be tricky. You could try the FCodes - try to get the FCode for the manual command and then call it. I do not have time to figure out the code at this point but others are sure to reply.

Ciao

Translate
Jacob_AA
Jacob_AAAuthor
Known Participant
Jan 18, 2019 11:25 AM UTC

Can you please say what is FCodes ?

Translate
Jacob_AA
Jacob_AAAuthor
Known Participant
Jan 8, 2019 11:18 AM UTC

I'm able to update manually. But it doesn't work with the script.

var doc = app.ActiveDoc;

doc .UpdateXRefs(Constants.FF_XRUI_INTERNAL);

Translate
4everJang
Legend
Jan 8, 2019 11:25 AM UTC

Try adding this line:

oDoc.Redisplay( );

Translate
4everJang
Legend
Jan 8, 2019 11:09 AM UTC

Hello Jacob,

Try this code:

var oDoc = app.ActiveDoc;

oDoc.UpdateXRefs( Constants.FF_XRUI_INTERNAL );

I would not update all XRefs from a script, as it may cause a lot of waiting when FM tries to open all files, process them and then update the XRefs. Check the Scripting Guide. Find the UpdateXRefs method of the Doc object to find other switches you can use (updating only XRefs to currently opened docs, for instance).

Good luck

4everJang

Translate