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

what is difference between everyItem().update() , update() , relink()

Explorer ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

hi

 

i would like know what is the action do per each function exactly

 

because i have an issue with one file linked, and update() do noting, and relink(), i m not sur relink() do what i want

 

for be sur i want find the action for reimport again, and check is date of import is changed

 

and for everyItem().update()

 when you have a file with all link with yellow triangle symbol, this action will update all link or not?

 

because into my script before save and close i do this action doc.everyItem().update(), and after i do doc.close(saveoption.yes)

 

and when i reopen the doc, my all link are not update, and i don t understand why..

 

thanks

TOPICS
Scripting

Views

205

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
People's Champ ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

Feels like everything is precise here : https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Link.html#d1e299632__d1e300391

Something you may consider is that the links were actually updated BUT…the links resources were updated after the doc was closed (a single change in the modification date will do or different sync settings in time between servers) and then on the next reopen, you have your non-updated links.

A way to check that would be to store the modification date of the resource when your script operates and compare it afterward.

You may as well add a loop to your script before closing to check link statuses. If ID claims they are all up to date, I don't see why they wouldn't be once you reopen the file unless they were actually modified (once again, not necessarily physically modified).

Loic

 

 

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
Explorer ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

in fact to explain everything to you, I watch the script run, and I can see the yellow triangles disappearing gradually in the linked files, so level -1
as it goes up in the "main" file, the yellow triangle changes symbol to one with a gray bar underneath. then before I did the action in 3 times
first is updated of all the links (everyItem().update()), from there I no longer have a yellow flag, then I do doc.save(), and there I have a problem the little star next to the filename should disappear, but it doesn't.
then doc.close()
and there I see that the recording date of the file has changed, but when I reopen, my triangles are still yellow....I'll make a video for you to understand better, I made a test file rather short

 

 

about checkif all is update, someone give me a code, but i have not yet adapt it

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
Explorer ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

you can watch here the result

 

https://youtu.be/xKS4YNvGvnM

 

before close each document i do 

        doc.links.everyItem().update();
        doc.close(SaveOptions.yes);

 

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
People's Champ ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

I can't say much more. If the link is to be updated, then an update occurred or the update did fail ut you should get an error. If there was an obvious bug with updating links, it's likely it would be a bug issue many would have shared.

What about testing on a dummy file with local resources? Then you can see on your own

Loic 

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
Explorer ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

It s too complicate to move all file in local

 

Because all link will be broken, and file is heavy

 

 

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
Explorer ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

maybe i can try with

 

undefined replaceWithOriginal ()

Experimental: Download the original asset and replace FPO with it.

undefined reinitLink (linkResourceURI:String)

Experimental: Reinitialize the link to a new uri

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
People's Champ ,
Nov 07, 2022 Nov 07, 2022

Copy link to clipboard

Copied

LATEST

If it's "too" complicated, build your own dummy local file.

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