CC2019: Can't update or relink a link when a document is opened by a script.
A fault introduced in CC2019: can't update or relink a link when a document is opened by a script.
Steps to reproduce:
- To verify that with an existing open document the problem does not occur: a. Start a new InDesign document b. Place a graphic on the first page c. Run this script:
No error occurs.
- To reproduce the error: a. Save the document created in step 1 and close it. b. Run this script:
s = '/d/test/links.indd'; // Use your string
Expected result: The links should be updated.
Actual result: "Error: This file is already open by another user or another application. This file may be stored on a network server and cannot be opened until the other user closes it."
Note 1: It doesn't matter that in this example the link doesn't actually need updating. The result is the same with out-of-date links.
Note 2: The problem is not confined to update(): it also occurs when you relink a link.
Please can you provide some more information related to the issue?
2. Document and imported file location (local or network)
3. File system type
4. Can you share a sample document along with the imported file.
5. Is the issue reproducible in ID 2020?
6. A small video will help as well
I have run across this bug, too, and documented my testing in some detail here: https://community.adobe.com/t5/indesign-discussions/extendscript-can-t-update-placed-graphic-if-document-was-opened-by-script/m-p/13824714.
I discovered that the bug relates to having the "Find Missing Links Before Opening Documents" preference setting OFF.
However, this preference doesn't seem directly related to this issue, and that there seems no reason why it *should* throw an error (after all, it only throws the error if the script opened the document—it throws no error if the document is already open). Seems like an unnecessary point of failure with very poor messaging to the scripter as to what went wrong and why.
Christoph Senn commented
Hello InDesign Team. There is a thread in the Community Forum which has an example where it seems exactly this is happening (in InDesign 2023).
Was there ever any news on this?
Peter Kahrel commented
For some reason I cannot reliably reproduce this problem (and a similar problem with relink()). I'll keep trying and will either re-open this ticket or a open a new one. For now, this one can be closed. Apologies.
Jim Birkenseer commented
FWIW, I was not able to replicate this issue on Mac (High Sierra) or Windows 10 Pro using the steps in the message. I was able to test this using ID v14.0.0 and v14.0.1 (because I hadn't updated ID before doing this test) and no errors were reported.