Copy link to clipboard
Copied
Hello everyone,
i want to embed the Images in around 500 InDesign Templates i have, to send each in one file with all the images included.
So i have 500 InDesign files where is all included.
There is no batch processing in Indesign i think and the Script i found, don't include the embedding of images.
If you have a solution for this problem, I would be very happy about an answer.
Thank you
You can try this code:
Where you have to select folder containing all the indesign files:
var myFolder = Folder.selectDialog ("Select Folder with all indd files");
var allINDDFiles = myFolder.getFiles("*.indd");//here you can change extension of you files ===
for(var i = 0; i < allINDDFiles.length; i++){
try{
var myDoc = app.open(allINDDFiles);
myDoc.links.everyItem().unlink();
myDoc.close(SaveOptions.YES);
}
catch(e){}
}
Best
Sunil
Copy link to clipboard
Copied
That is a horrible plan for anything other than the tiniest of images.
Instead, use the file > package command and then zip the package.
Copy link to clipboard
Copied
Thank you for the response.
Each of the file has only two pages, so its not the size, thats okay.
But i need a baching process to make it for over 500 files. Do you have a solution for that?
Copy link to clipboard
Copied
Do a book, add all files without auto-numbering. Do package of the book.
Tips & Techniques: Packaging multiple files at once
Copy link to clipboard
Copied
But is there an option to embedding the images in this process so i get only the .indd files with the images embedding in there and no other folders with the images?
I can do it manually, but then i have to open 500+ files and embedding all the pictures, save the file and close it.
I only need a process to automatic this step.
Copy link to clipboard
Copied
Moving the discussion to InDesign Scripting community.
Copy link to clipboard
Copied
I agree with Bob, but if your hand is forced and this is the way you have to do it, there is a script that will embed images in a file:
https://indesignsecrets.com/topic/automatically-embed-all-links-in-indesign
This will do one document at a time. However, combine this with Peter Kahrel's Batch Convert script and you could do it. Free script Batch convert/export InDesign documents | Peter Kahrel
You'd have all your ID files in one folder, run Peter's script, and convert from ID to an ID file, making sure to save changes on closing and to run the first script.
Copy link to clipboard
Copied
I agree, that's a suboptimal idea…
but if your really have to: Embedding Graphics in InDesign files via extension script · Issue #129 · Adobe-CEP/CEP-Resources · G...
Copy link to clipboard
Copied
Embedding images is the prominent reason when I get corrupted files. I cannot recommend to embed any image into InDesign.
Copy link to clipboard
Copied
I embed images all the time in InDesign files and <knock on wood> haven't had a file get corrupted from it ever. Many times it's the most convenient and sensible way to move layouts around, especially when sending to users not that familiar w/InDesign.
I think Colin Flashman's solution will work the best. I just tried that script in CC 2019 and it works fine.
AM
Copy link to clipboard
Copied
You can try this code:
Where you have to select folder containing all the indesign files:
var myFolder = Folder.selectDialog ("Select Folder with all indd files");
var allINDDFiles = myFolder.getFiles("*.indd");//here you can change extension of you files ===
for(var i = 0; i < allINDDFiles.length; i++){
try{
var myDoc = app.open(allINDDFiles);
myDoc.links.everyItem().unlink();
myDoc.close(SaveOptions.YES);
}
catch(e){}
}
Best
Sunil