Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: Rename and relink images - Indesign CS4 - OSX10.5

$
0
0

It seems I actually solved the problem by adjusting another script found here:

http://jsid.blogspot.dk/2006/03/replacing-links.html

 

 

//Description: Replace images with prefix to another language

/*

   Existing images have the prefix "DK"; New have the prefix "SE"

*/

 

myDoc = app.activeDocument;

myLinks = myDoc.links;

for (j = myLinks.length - 1; j >= 0; j--) {

  myName = myLinks[j].filePath;

  myNewName = myName.split("DK").join("SE");

  if (myName != myNewName) {

    // Originale images have the prefix "DK"

    myNewImageFile = File(myNewName);

    if (!myNewImageFile.exists) {

     alert ("Can't find file: " + myNewName);

      continue;

    }

    myLinks[j].relink(myNewImageFile);

    myLinks[j].update();

  }

}

 

Hope others can find use of it.


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>