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

Re-link lots of images? Indesign CS3

New Here ,
Apr 17, 2008 Apr 17, 2008
Hi - I posted this in the indesign forum and it was suggested to look here. I've had a quick look for a solution but thought I'd post aswell.

"Because I've resaved a load of jpegs to psds the links are now broken.

Is it possible to relink them all without doing each one manually?

The update link option is greyed out. All the psds are in the same folder. "

Thanks again
TOPICS
Scripting
15.0K
Translate
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
New Here ,
Oct 30, 2008 Oct 30, 2008
Hi dugie

I have just seen your post

You could try changing:

function pagenum(myNumber){

to

function pad000(myNumber){

This should work

Regards
Duncan
Translate
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
New Here ,
Oct 31, 2008 Oct 31, 2008
Hi jongware

Thanks for that link - i have downloaded & it is great!

Far quicker than cross-referencing through books (& more up-to-date)

Regards
Duncan
Translate
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
Valorous Hero ,
Nov 03, 2008 Nov 03, 2008
Here is a new version of the previously posted script, which renames images on pages like so:
001_a.tif
002_b.tif

Now it uses letters from a-z for the images.

And it gives you a warning before renaming the links, which is quite prudent.
I am amazed at how different people in this forum make improvements to a script, making it better and better.



var myPages = app.activeDocument.pages;
var myProcessed = Object;
var myOrder = prompt("Example: thebook_08765", "Job description", "Please enter job description");
var response = confirm("Warning: You are about to rename all images linked to the foremost Indesign Document - proceed? Keep in mind - it is not reversible!");

if (response == true)
{
for (var p = 0; p < myPages.length; p++) {

var myPageNumber = pad000(myPages

.name);
var myImages = myPages

.allGraphics;
var myImageCounter = 0;
var myLetterCounter = 0;

for (i = myImages.length-1; i >= 0 ; i--) {

myImageCounter++;

var myLink = myImages.itemLink;
var myOldLinkName = myLink.name;

if (! myProcessed[myOldLinkName]) {
var myImageNumber = pad000(myImageCounter);
var myLetter = getLetter(myLetterCounter);
myLetterCounter++;
var myExtension = myOldLinkName.substr(myOldLinkName.lastIndexOf( "." ));
var myNewLinkName = myPageNumber + "_" + myLetter + "_" + myOrder + myExtension;
var myOldImageHDfile = new File(myLink.filePath);
myOldImageHDfile.rename(myNewLinkName);
myProcessed[myOldLinkName] = myOldImageHDfile;
}
myLink.relink(myProcessed[myOldLinkName]);
myLink.update();

}
}

function pad000(myNumber) {
if (myNumber >= 1 && myNumber <= 9) {
x = "0" + "0" + myNumber;
}
else if (myNumber >= 10 && myNumber <= 99) {
x = "0" + myNumber;
}
else if (myNumber >= 100 && myNumber <= 999) {
x = myNumber;
}
return x;
}
}

function getLetter(myLetterCounter){
var myArray = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','w','x','y','z'];
if (myLetterCounter <= myArray.length-1) {
return myArray[myLetterCounter];
}
else {
return "" + myLetterCounter;
}
}

Translate
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 ,
Nov 03, 2008 Nov 03, 2008
Hi Kasyan,

If you allow me to make two suggestions, you could shorten your two functions pad000 and getLetter:
function pad000(myNumber) {

return ('000'+myNumber).match (/...$/)[0]
}

function getLetter(myLetterCounter) {
if (myLetterCounter <= 26)
return String.fromCharCode (myLetterCounter+96);
return String (myLetterCounter)
}


These are just variants, they're not any better.

Peter
Translate
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
Valorous Hero ,
Nov 03, 2008 Nov 03, 2008
Thank you, Peter!

It's high time me got down to studying regular expressions.

Kasyan

P.S. And string object methods too.
Translate
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
New Here ,
Nov 03, 2008 Nov 03, 2008
No different to Kasyan's really - just without the function for the a,b,c ... bit

var myDoc = app.activeDocument;
var myAllLinks = myDoc.allGraphics;
var mySeen = Object;

var myPrepend = prompt("Example: thebook_08765", "Job description", "Please enter job description");
var response = confirm("Warning: You are about to rename all images linked to the foremost Indesign Document - proceed? Keep in mind - it is not reversible!");

if ( response == true )
{

for ( i = 0; i < myAllLinks.length; i++ )
{
var myLinkName = myAllLinks.itemLink.name;

if ( mySeen[myLinkName] )
{
mySeen[myLinkName]++;
} else {
mySeen[myLinkName] = 1;
}
}

var myPages = myDoc.pages;

for ( p = 0; p < myPages.length; p++ )
{
var myPageNumber = pad000( myPages

.name );
var myLinks = myPages

.allGraphics;

var myASCII = 97;

for ( i = myLinks.length - 1; i >= 0; i-- )
{
var myLink = myLinks.itemLink;
var myOldLinkName = myLink.name;

if ( mySeen[myOldLinkName] == 1 )
{
var myExtension = myOldLinkName.substr(myOldLinkName.lastIndexOf( "." ));
var myNewLinkName = myPrepend + '_P' + myPageNumber + String.fromCharCode( myASCII ) + myExtension;

var myOldImageHDfile = new File( myLink.filePath );
myOldImageHDfile.rename( myNewLinkName );

myLink.relink( myOldImageHDfile );
myLink.update();

myASCII++;
}
}
}

}

function pad000(myNumber) {
if (myNumber >= 1 && myNumber <= 9) {
x = "0" + "0" + myNumber;
} else if (myNumber >= 10 && myNumber <= 99) {
x = "0" + myNumber;
} else if (myNumber >= 100 && myNumber <= 999) {
x = myNumber;
}
return x;
}

Regards
Duncan

Translate
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
New Here ,
Nov 03, 2008 Nov 03, 2008
No different to Kasyan's really - just without the function for the a,b,c ... bit

var myDoc = app.activeDocument;

var myAllLinks = myDoc.allGraphics;
var mySeen = Object;

var myPrepend = prompt("Example: thebook_08765", "Job description", "Please enter job description");
var response = confirm("Warning: You are about to rename all images linked to the foremost Indesign Document - proceed? Keep in mind - it is not reversible!");

if ( response == true )
{

for ( i = 0; i < myAllLinks.length; i++ )
{
var myLinkName = myAllLinks.itemLink.name;

if ( mySeen[myLinkName] )
{
mySeen[myLinkName]++;
} else {
mySeen[myLinkName] = 1;
}
}

var myPages = myDoc.pages;

for ( p = 0; p < myPages.length; p++ )
{
var myPageNumber = pad000( myPages

.name );
var myLinks = myPages

.allGraphics;

var myASCII = 97;

for ( i = myLinks.length - 1; i >= 0; i-- )
{
var myLink = myLinks.itemLink;
var myOldLinkName = myLink.name;

if ( mySeen[myOldLinkName] == 1 )
{
var myExtension = myOldLinkName.substr(myOldLinkName.lastIndexOf( "." ));
var myNewLinkName = myPrepend + '_P' + myPageNumber + String.fromCharCode( myASCII ) + myExtension;

var myOldImageHDfile = new File( myLink.filePath );
myOldImageHDfile.rename( myNewLinkName );

myLink.relink( myOldImageHDfile );
myLink.update();

myASCII++;
}
}
}

}

function pad000(myNumber) {
if (myNumber >= 1 && myNumber <= 9) {
x = "0" + "0" + myNumber;
} else if (myNumber >= 10 && myNumber <= 99) {
x = "0" + myNumber;
} else if (myNumber >= 100 && myNumber <= 999) {
x = myNumber;
}
return x;
}

Regards
Duncan

Translate
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
New Here ,
Nov 03, 2008 Nov 03, 2008
No different to Kasyan's really - just without the function for the a,b,c ... bit

var myDoc = app.activeDocument;
var myAllLinks = myDoc.allGraphics;
var mySeen = Object;

var myPrepend = prompt("Example: thebook_08765", "Job description", "Please enter job description");
var response = confirm("Warning: You are about to rename all images linked to the foremost Indesign Document - proceed? Keep in mind - it is not reversible!");

if ( response == true )
{

 for ( i = 0; i < myAllLinks.length; i++ )
 {
  var myLinkName = myAllLinks.itemLink.name;
  
  if ( mySeen[myLinkName] )
  {
   mySeen[myLinkName]++;
  } else {
   mySeen[myLinkName] = 1;
  }
 }
 
 var myPages = myDoc.pages;
 
 for ( p = 0; p < myPages.length; p++ )
 {
  var myPageNumber = pad000( myPages

.name );
  var myLinks = myPages

.allGraphics;
 
  var myASCII = 97;
  
  for ( i = myLinks.length - 1; i >= 0; i-- )
  {
   var myLink = myLinks.itemLink;
   var myOldLinkName = myLink.name;
   
   if ( mySeen[myOldLinkName] == 1 )
   {
    var myExtension = myOldLinkName.substr(myOldLinkName.lastIndexOf( "." ));
    var myNewLinkName = myPrepend + '_P' + myPageNumber + String.fromCharCode( myASCII ) + myExtension;
    
    var myOldImageHDfile = new File( myLink.filePath );
     myOldImageHDfile.rename( myNewLinkName );
    
    myLink.relink( myOldImageHDfile );
    myLink.update();
    
    myASCII++;
   }
  }
 }
 
}

function pad000(myNumber) {
 if (myNumber >= 1 && myNumber <= 9) {
  x = "0" + "0" + myNumber;
 } else if (myNumber >= 10 && myNumber <= 99) {
  x = "0" + myNumber;
 } else if (myNumber >= 100 && myNumber <= 999) {
  x = myNumber;
 }
 return x;
}

Translate
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
New Here ,
Nov 03, 2008 Nov 03, 2008
No different to Kasyan's really - just without the function for the a,b,c ... bit

var myDoc = app.activeDocument;

var myAllLinks = myDoc.allGraphics;
var mySeen = Object;

var myPrepend = prompt("Example: thebook_08765", "Job description", "Please enter job description");
var response = confirm("Warning: You are about to rename all images linked to the foremost Indesign Document - proceed? Keep in mind - it is not reversible!");

if ( response == true )
{

for ( i = 0; i < myAllLinks.length; i++ )
{
var myLinkName = myAllLinks.itemLink.name;

if ( mySeen[myLinkName] )
{
mySeen[myLinkName]++;
} else {
mySeen[myLinkName] = 1;
}
}

var myPages = myDoc.pages;

for ( p = 0; p < myPages.length; p++ )
{
var myPageNumber = pad000( myPages

.name );
var myLinks = myPages

.allGraphics;

var myASCII = 97;

for ( i = myLinks.length - 1; i >= 0; i-- )
{
var myLink = myLinks.itemLink;
var myOldLinkName = myLink.name;

if ( mySeen[myOldLinkName] == 1 )
{
var myExtension = myOldLinkName.substr(myOldLinkName.lastIndexOf( "." ));
var myNewLinkName = myPrepend + '_P' + myPageNumber + String.fromCharCode( myASCII ) + myExtension;

var myOldImageHDfile = new File( myLink.filePath );
myOldImageHDfile.rename( myNewLinkName );

myLink.relink( myOldImageHDfile );
myLink.update();

myASCII++;
}
}
}

}

function pad000(myNumber) {
if (myNumber >= 1 && myNumber <= 9) {
x = "0" + "0" + myNumber;
} else if (myNumber >= 10 && myNumber <= 99) {
x = "0" + myNumber;
} else if (myNumber >= 100 && myNumber <= 999) {
x = myNumber;
}
return x;
}

Translate
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
New Here ,
Nov 03, 2008 Nov 03, 2008
No different to Kasyan's really - just without the function for the a,b,c ... bit

var myDoc = app.activeDocument;
var myAllLinks = myDoc.allGraphics;
var mySeen = Object;

var myPrepend = prompt("Example: thebook_08765", "Job description", "Please enter job description");
var response = confirm("Warning: You are about to rename all images linked to the foremost Indesign Document - proceed? Keep in mind - it is not reversible!");

if ( response == true )
{

for ( i = 0; i < myAllLinks.length; i++ )
{
var myLinkName = myAllLinks.itemLink.name;

if ( mySeen[myLinkName] )
{
mySeen[myLinkName]++;
} else {
mySeen[myLinkName] = 1;
}
}

var myPages = myDoc.pages;

for ( p = 0; p < myPages.length; p++ )
{
var myPageNumber = pad000( myPages

.name );
var myLinks = myPages

.allGraphics;

var myASCII = 97;

for ( i = myLinks.length - 1; i >= 0; i-- )
{
var myLink = myLinks.itemLink;
var myOldLinkName = myLink.name;

if ( mySeen[myOldLinkName] == 1 )
{
var myExtension = myOldLinkName.substr(myOldLinkName.lastIndexOf( "." ));
var myNewLinkName = myPrepend + '_P' + myPageNumber + String.fromCharCode( myASCII ) + myExtension;

var myOldImageHDfile = new File( myLink.filePath );
myOldImageHDfile.rename( myNewLinkName );

myLink.relink( myOldImageHDfile );
myLink.update();

myASCII++;
}
}
}

}

function pad000(myNumber) {
if (myNumber >= 1 && myNumber <= 9) {
x = "0" + "0" + myNumber;
} else if (myNumber >= 10 && myNumber <= 99) {
x = "0" + myNumber;
} else if (myNumber >= 100 && myNumber <= 999) {
x = myNumber;
}
return x;
}

Translate
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
New Here ,
Nov 03, 2008 Nov 03, 2008
No different to Kasyan's really - just without the function for the a,b,c ... bit

var myDoc = app.activeDocument;


var myAllLinks = myDoc.allGraphics;

var mySeen = Object;



var myPrepend = prompt("Example: thebook_08765", "Job description", "Please enter job description");

var response = confirm("Warning: You are about to rename all images linked to the foremost Indesign Document - proceed? Keep in mind - it is not reversible!");



if ( response == true )

{



for ( i = 0; i < myAllLinks.length; i++ )

{

var myLinkName = myAllLinks.itemLink.name;



if ( mySeen[myLinkName] )

{

mySeen[myLinkName]++;

} else {

mySeen[myLinkName] = 1;

}

}



var myPages = myDoc.pages;



for ( p = 0; p < myPages.length; p++ )

{

var myPageNumber = pad000( myPages

.name );

var myLinks = myPages

.allGraphics;



var myASCII = 97;



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

{

var myLink = myLinks.itemLink;

var myOldLinkName = myLink.name;



if ( mySeen[myOldLinkName] == 1 )

{

var myExtension = myOldLinkName.substr(myOldLinkName.lastIndexOf( "." ));

var myNewLinkName = myPrepend + '_P' + myPageNumber + String.fromCharCode( myASCII ) + myExtension;



var myOldImageHDfile = new File( myLink.filePath );

myOldImageHDfile.rename( myNewLinkName );



myLink.relink( myOldImageHDfile );

myLink.update();



myASCII++;

}

}

}



}



function pad000(myNumber) {

if (myNumber >= 1 && myNumber <= 9) {

x = "0" + "0" + myNumber;

} else if (myNumber >= 10 && myNumber <= 99) {

x = "0" + myNumber;

} else if (myNumber >= 100 && myNumber <= 999) {

x = myNumber;

}

return x;

}



Regards
Duncan
Translate
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
New Here ,
Nov 03, 2008 Nov 03, 2008
No different to Kasyan's really - just without the function for the a,b,c ... bit


var myDoc = app.activeDocument;

var myAllLinks = myDoc.allGraphics;

var mySeen = Object;



var myPrepend = prompt("Example: thebook_08765", "Job description", "Please enter job description");

var response = confirm("Warning: You are about to rename all images linked to the foremost Indesign Document - proceed? Keep in mind - it is not reversible!");



if ( response == true )

{



for ( i = 0; i < myAllLinks.length; i++ )

{

var myLinkName = myAllLinks.itemLink.name;

if ( mySeen[myLinkName] )

{

mySeen[myLinkName]++;

} else {

mySeen[myLinkName] = 1;

}

}

var myPages = myDoc.pages;

for ( p = 0; p < myPages.length; p++ )

{

var myPageNumber = pad000( myPages

.name );

var myLinks = myPages

.allGraphics;

var myASCII = 97;

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

{

var myLink = myLinks.itemLink;

var myOldLinkName = myLink.name;

if ( mySeen[myOldLinkName] == 1 )

{

var myExtension = myOldLinkName.substr(myOldLinkName.lastIndexOf( "." ));

var myNewLinkName = myPrepend + '_P' + myPageNumber + String.fromCharCode( myASCII ) + myExtension;

var myOldImageHDfile = new File( myLink.filePath );

myOldImageHDfile.rename( myNewLinkName );

myLink.relink( myOldImageHDfile );

myLink.update();

myASCII++;

}

}

}

}



function pad000(myNumber) {

if (myNumber >= 1 && myNumber <= 9) {

x = "0" + "0" + myNumber;

} else if (myNumber >= 10 && myNumber <= 99) {

x = "0" + myNumber;

} else if (myNumber >= 100 && myNumber <= 999) {

x = myNumber;

}

return x;

}



Regards
Duncan
Translate
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
New Here ,
Nov 03, 2008 Nov 03, 2008
No different to Kasyan's really - just without the function for the a,b,c ... bit


var myDoc = app.activeDocument;
var myAllLinks = myDoc.allGraphics;
var mySeen = Object;

var myPrepend = prompt("Example: thebook_08765", "Job description", "Please enter job description");
var response = confirm("Warning: You are about to rename all images linked to the foremost Indesign Document - proceed? Keep in mind - it is not reversible!");

if ( response == true )
{

for ( i = 0; i < myAllLinks.length; i++ )
{
var myLinkName = myAllLinks.itemLink.name;
if ( mySeen[myLinkName] )
{
mySeen[myLinkName]++;
} else {
mySeen[myLinkName] = 1;
}
}
var myPages = myDoc.pages;
for ( p = 0; p < myPages.length; p++ )
{
var myPageNumber = pad000( myPages

.name );
var myLinks = myPages

.allGraphics;
var myASCII = 97;
for ( i = myLinks.length - 1; i >= 0; i-- )
{
var myLink = myLinks.itemLink;
var myOldLinkName = myLink.name;
if ( mySeen[myOldLinkName] == 1 )
{
var myExtension = myOldLinkName.substr(myOldLinkName.lastIndexOf( "." ));
var myNewLinkName = myPrepend + '_P' + myPageNumber + String.fromCharCode( myASCII ) + myExtension;
var myOldImageHDfile = new File( myLink.filePath );
myOldImageHDfile.rename( myNewLinkName );
myLink.relink( myOldImageHDfile );
myLink.update();
myASCII++;
}
}
}
}

function pad000(myNumber) {
if (myNumber >= 1 && myNumber <= 9) {
x = "0" + "0" + myNumber;
} else if (myNumber >= 10 && myNumber <= 99) {
x = "0" + myNumber;
} else if (myNumber >= 100 && myNumber <= 999) {
x = myNumber;
}
return x;
}



Regards
Duncan
Translate
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
New Here ,
Nov 03, 2008 Nov 03, 2008
Sorry - looks like i can't even deal with the HTML of this site!

Duncan
Translate
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
Valorous Hero ,
Nov 03, 2008 Nov 03, 2008
Duncan,

Please use script poster when you post scripts in the forum:
This version is for ESTK2


var asciiFile = new File(File.openDialog("Open File to convert","Javascript:*.jsx;"));
OutHTM = new File(decodeURI($.getenv("TEMP")) + "/Code2HTM.txt");
asciiFile.open("r");
OutHTM.open("w");
var FileString = asciiFile.read();
asciiFile.close();
OutHTM.writeln("<PRE><BR>");
for (a=0;a<FileString.length;a++){
c=FileString;
Write(c);
}
OutHTM.writeln("</PRE>");
OutHTM.close();
OutHTM.execute();
function Write(Char)...











Translate
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
New Here ,
Nov 03, 2008 Nov 03, 2008
Apologies Kasyan

Thanks
Duncan
Translate
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
New Here ,
Nov 07, 2008 Nov 07, 2008
Grrrr! I don't know how to say this without coming across sounding ungrateful for all the hard work you guys have put into this script but... in the future can we please keep the thread to the original functionality of the script? Halfway through this one the script changed from relinking images to changing the file names. I grabbed one of the code samples and ran it and now have a bunch of files with names that don't fit my naming convention when I thought I was running the relink script.
Translate
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
Valorous Hero ,
Nov 07, 2008 Nov 07, 2008
I'm so sorry, stealthrocket didn't mean any mischief.
Translate
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
Valorous Hero ,
Dec 03, 2008 Dec 03, 2008
Hi all,

Ive made a new version of update path names in links script.
http://www.businessweekly.h.com.ua/relink.html
The previous one had a problem with the links placed more than once: only one instance of such a link was relinked. (Thanks to Ed for reporting about the bug.)
There was also a problem with final report. Sometimes it incorrectly stated: Nothing has been relinked.
Now the script works with links not images so you can relink text files as well (e.g. InCopy files).

If you encounter any bugs, please report me to askoldich@yahoo.com or kasyan@business.ua

Kasyan
Translate
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 ,
Dec 03, 2008 Dec 03, 2008
Thanks, Kasyan!
Translate
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
Valorous Hero ,
Dec 18, 2008 Dec 18, 2008
Hi all,

I remade my script again. The previous version worked extremely slowly if the document contained the same links placed several times (thanks Ed for reporting the bug). I also corrected a few minor problems.
You can get the current version of the script from here:
http://www.kasyan.ho.com.ua/relink.html

Kasyan
Translate
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
New Here ,
May 29, 2009 May 29, 2009

My friend, you are a GENIUS.  You just saved me hours and hours of time, literally.  I had 123 images that I moved to a new folder, and it took about 4 or 5 minutes for your script to re-link them.  AWESOME.

For those of you who are looking to use the script, just download it from Kasyan's site, put it in the "Program Files\Adobe\Adobe InDesign CS3\Scripts\Scripts Panel".  Then in InDesign, open the Scripts Panel (Window>Automation>Scripts), and double-click on the .js file.  Pick the NEW folder where your images are located, and VOILA.

Thanks a million, Kasyan.

Dave Cooperstein.

Translate
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
New Here ,
Apr 01, 2011 Apr 01, 2011

Kasyan,

I kind of have the opposite problem, I would like to embed the images in a CS3, do you know of a way to do it through scripting?

I've tried using the link.unlink() function which is supposed to embed the source file in the document, but afterwards the link still shows as linked and not embedded (I see no effects from this function).

Any ideas?

Thanks,

Raul

Translate
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
Valorous Hero ,
Apr 04, 2011 Apr 04, 2011

Hi Raul,

Something weird is going on with adobe forums: I am able to log in here only on rare occasions – that's why I couldn't answer you earlier.

Here is a simple example showing how to embed all images in the active document:

var i,
doc = app.activeDocument,
links = doc.links;

for (i = links.length-1; i >= 0; i--) {
     links.unlink();
}

Hope this helps.

Regards,

Kas

Translate
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
New Here ,
Apr 04, 2011 Apr 04, 2011

Thanks Aksyan for replying, unfortunately the unlink function is not having any effect on my document's images, but now that I have confirmation that's the way to go, I'll look deeper into why it's not updating the link's status.

Maybe it's because I'm referencing the link through the graphic, I'll try it from the document's collection directly and see if that makes a difference.

Raul

Translate
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