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

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

Community Beginner ,
Sep 18, 2020 Sep 18, 2020

Copy link to clipboard

Copied

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.

TOPICS
Bug , Scripting

Views

304

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

correct answers 2 Correct answers

Community Expert , Sep 18, 2020 Sep 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;

 

 

 

 

 

Votes

Translate

Translate
Community Expert , Mar 31, 2021 Mar 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.

Votes

Translate

Translate
Community Expert ,
Sep 18, 2020 Sep 18, 2020

Copy link to clipboard

Copied

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;

 

 

 

 

 

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 ,
Mar 31, 2021 Mar 31, 2021

Copy link to clipboard

Copied

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.

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 ,
Mar 31, 2021 Mar 31, 2021

Copy link to clipboard

Copied

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.

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 ,
Mar 31, 2021 Mar 31, 2021

Copy link to clipboard

Copied

LATEST

It appears to be working and is updating much faster! This srcipt is a life saver and I will probably be using it several times per day! Thanks a ton!

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