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

Image Link with hidden layer images

Participant ,
Sep 24, 2020 Sep 24, 2020

Copy link to clipboard

Copied

Hi everyone,

I could not able to relink the images due to Internal Linked story in the link palette. I try to ignore and run the script it wont work. Could anyone help me out from this.

linksDetails is an array I stored the multiple folder path for relink.

 

    doc = app.activeDocument;
    var LinksDoc = [];
    var myLinks = doc.links;
    var saveDoc = false;
    if(myLinks.length>0){
        for(a=0; a<myLinks.length; a++){
            if(myLinks[a].linkType != "Internal Linked Story" || myLinks[a].linkType != "Internal Linked Object"){
                var singleImages = String(linksDetails).split(",");
                for(b=0; b<singleImages.length; b++){
                        alert(myLinks[a].name);
                    if(singleImages[b].search(myLinks[a].name) > 0) {
                        myLinks[a].show();
                        var newLinkPath = File(singleImages[b]);
                        myLinks[a].relink(newLinkPath);
                        saveDoc = true;
                        break;
                    }
                }
            }
            saveDoc = true;
        }

 

TOPICS
Scripting

Views

219

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 1 Correct answer

Community Expert , Sep 24, 2020 Sep 24, 2020

How is it not working? Does it throw an error? 

 

First thing is to wrap everything within your for block in a try/catch statement. This will skip through any errors.

 

Secondly, String.search is not available in ExtendScript. Use String.indexOf instead (>= 0, since 0 would return the start of the string). 

 

Votes

Translate

Translate
Community Expert ,
Sep 24, 2020 Sep 24, 2020

Copy link to clipboard

Copied

LATEST

How is it not working? Does it throw an error? 

 

First thing is to wrap everything within your for block in a try/catch statement. This will skip through any errors.

 

Secondly, String.search is not available in ExtendScript. Use String.indexOf instead (>= 0, since 0 would return the start of the string). 

 

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