Skip to main content
iCFO
Participant
September 18, 2020
Answered

Script to auto answer "edits have been made" dialog when updating links.

  • September 18, 2020
  • 1 reply
  • 651 views

Hey everyone,

 

The lack of a "Yes to All" button when updating all links to a file is debilitating for me. I literally have to press enter almost 3,000 times for over an hour to do an "update all" on a large .xls doc (sometimes several times per day) because there is no "Yes to All" or "Ignore this Warning" option for the below dialog...

 

"Edits have been made to the imported version of "document name.here". You will lose these edits (with the exception of changes applied to spreadsheets through cell styles or table styles) when you update the link. Update anyway?"

 

 

All of my changes are always applied via cell and table styles, so the message doesn't even apply to me. It is a pretty infuriating waste of time for an easy "Yes to All" button addition. Adobe support seems to be a black hole for extreme use case issues like these. Could I use a script to suppress or auto answer this dialog? Maybe a universal on / off script for all user notifications might work as well? Not sure where to start.

This topic has been closed for replies.
Correct answer Peter Kahrel

Looks as if you rekeyed the script and used = instead of == in the line that checks a link's status: 

if (links[i].status == LinkStatus.LINK_OUT_OF_DATE)

 Make sure that you == there.

1 reply

brian_p_dts
Community Expert
Community Expert
September 18, 2020

You could try this to update all links in a document with dialog interaction suppressed.

 

 

var currIL = app.scriptPreferences.userInteractionLevel;
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

var links = app.documents[0].links.everyItem().getElements();
for (var i = 0; i < links.length; i++) {
    if (links[i].status == LinkStatus.LINK_OUT_OF_DATE) {
        links[i].update();
    }
}

app.scriptPreferences.userInteractionLevel = currIL;

 

 

 

 

 

iCFO
iCFOAuthor
Participant
March 31, 2021

I was finally able to test this script and I got the following error... Could I simplify the code and bypass the risk of error by selecting the links that need to be updated prior to running the notification suppression script? If so, how do I modify the script to only update the selected links?

 

JavaScript Error!

 

Error Number: 30474

Error String: 'status' is a read only property.

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
March 31, 2021

Looks as if you rekeyed the script and used = instead of == in the line that checks a link's status: 

if (links[i].status == LinkStatus.LINK_OUT_OF_DATE)

 Make sure that you == there.