Skip to main content
Inspiring
November 7, 2022
Question

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

  • November 7, 2022
  • 1 reply
  • 539 views

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

This topic has been closed for replies.

1 reply

Loic.Aigon
Legend
November 7, 2022

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

 

 

Inspiring
November 7, 2022
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