Copy link to clipboard
Copied
Good Morning.
We get linked files that are PNG and we convert them to CMYK PSD file and keep them the same name except for the ext.
Is there a script that will relink PNG to PSD in Indesign. Right now we manually relinking each one in the links panel.
Thanks
Fred
No need for a script, go to the links panel and choose this in the dropdown menu (my screen shot is in French but you will easily understand)
Copy link to clipboard
Copied
No need for a script, go to the links panel and choose this in the dropdown menu (my screen shot is in French but you will easily understand)
Copy link to clipboard
Copied
There’s also no need to make the conversion to CMYK in Photoshop, the same conversion can be made from InDesign on an export to PDF or from the print RIP. On an Export, simply set the Output tab’s destination to Document CMYK and the RGB PNGs will be converted into your document’s assigned CMYK space.
Copy link to clipboard
Copied
Try this below snippet :
// You can include whatever Extension you wish for it in this below list for relinking
var extension = ["psd", "png"];
//============================================
var myDoc = app.documents[0];
for(var i = 0; i < myDoc.links.length; i++){
var imageName = myDoc.links[i].name.split(".")[0];
var folderPath = File(myDoc.links[i].filePath.replace(/\\/g,'/')).parent.fsName.replace(/\\/g,'/');
if(myDoc.links[i].status.toString() != "NORMAL"){
for(var x = 0; x < extension.length; x++){
if(File(folderPath+"/"+imageName+"."+extension[x]).exists){
myDoc.links[i].relink(File(folderPath+"/"+imageName+"."+extension[x]));
break;
}
}
}
}
//============================================
Best
Sunil
Copy link to clipboard
Copied
Here's a script I use for my workflow. It resaves the selected image as psd-file in photoshop as relinks it on InDesign.
However, it doesn't convert to CMYK, but a line of code can be added for this.
— Kas
Copy link to clipboard
Copied
Thank you for all the input. the relink in the links pallet is the one that looks like the best fit for us. I will try some of the scripts also. Leaving them RGB doesn't really work for our work flow.
Copy link to clipboard
Copied
Are you exporting to PDF for print? If so, the Destination CMYK profile can be set in the PDF export preset and the conversion output numbers would be the identical.
Copy link to clipboard
Copied
One of the things want to make sure the backgrounds of the photos match the other backgrounds in the indesign file. Thanks anyway
Copy link to clipboard
Copied
You can get matching output numbers and still work with RGB images—you would just have to make sure the ID Document and PNG RGB profiles are the same. Here I’ve placed an AdobeRGB PNG in an ID doc with AdobeRGB also assigned, and sampled its background. Separation Preview shows the output ISO Coated v2 CMYK numbers match—they will aso match on an export to PDF/X-4 or PDF/X-1a: