Copy link to clipboard
Copied
I have 111 NEW open documents in Indesign and I want to save and close them all in the same location, but since these are new files, after each one you have to hit enter to save in that location. Is there a script to save as new and then close in a batch?
**cmnd + opt + shift + S/W doesnt work because these are New files, that function works if its ReSaving documents
Copy link to clipboard
Copied
The files need a name, but something like this should work. You can change adoc to whatever filename you want to prepend.
var docs = app.documents;
var fol = Folder.selectDialog("Choose the folder to save to");
var i = docs.length;
while(i--) {
docs[i].saveAs(File(fol + "/adoc_" + i));
docs[i].close(SaveOptions.NO);
}
Copy link to clipboard
Copied
Thank you for the response, do you possibly have this in script file I can drop import into ID?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
My bad. Should just be save, not saveAs. Been working in Photoshop scripting lately which uses a different func.
Copy link to clipboard
Copied
No worries!
It works now! But it doesn't include the .indd filename extension, it saves the files without any extension. Is there a fix for that?
Copy link to clipboard
Copied
Change this line:
docs[i].saveAs(File(fol + "/adoc_" + i));
as follows:
docs[i].saveAs(File(fol + "/adoc_" + i + ".indd"));