• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Does anybody know how to update cross-references with ExtendScript

Community Beginner ,
Jan 08, 2019 Jan 08, 2019

Copy link to clipboard

Copied

Does anybody know how to update ?

TOPICS
Scripting

Views

493

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
community guidelines
Advocate ,
Jan 08, 2019 Jan 08, 2019

Copy link to clipboard

Copied

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

Votes

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
community guidelines
Community Beginner ,
Jan 08, 2019 Jan 08, 2019

Copy link to clipboard

Copied

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

var doc = app.ActiveDoc;

doc .UpdateXRefs(Constants.FF_XRUI_INTERNAL);

Votes

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
community guidelines
Advocate ,
Jan 08, 2019 Jan 08, 2019

Copy link to clipboard

Copied

Try adding this line:

oDoc.Redisplay( );

Votes

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
community guidelines
Community Expert ,
Jan 08, 2019 Jan 08, 2019

Copy link to clipboard

Copied

I always use the Everything flag:

doc.UpdateXRefs (Constants.FF_XRUI_EVERYTHING);

Votes

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
community guidelines
Community Beginner ,
Jan 18, 2019 Jan 18, 2019

Copy link to clipboard

Copied

Hi, this doesn't work for me.

Actually there are two functions:

UpdateXRefs

UpdateXRef

Votes

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
community guidelines
Community Beginner ,
Jan 08, 2019 Jan 08, 2019

Copy link to clipboard

Copied

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 ? 

Votes

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
community guidelines
Advocate ,
Jan 08, 2019 Jan 08, 2019

Copy link to clipboard

Copied

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

Votes

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
community guidelines
Community Beginner ,
Jan 18, 2019 Jan 18, 2019

Copy link to clipboard

Copied

LATEST

Can you please say what is FCodes ?

Votes

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
community guidelines