• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Batch Save and Close all open windows, INCLUDING the hit enter to save NEW documents

Explorer ,
Apr 28, 2023 Apr 28, 2023

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

 

TOPICS
Scripting

Views

650

Translate

Translate

Report

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 ,
Apr 28, 2023 Apr 28, 2023

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);
}

 

 

Votes

Translate

Translate

Report

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
Explorer ,
Apr 28, 2023 Apr 28, 2023

Copy link to clipboard

Copied

Thank you for the response, do you possibly have this in script file I can drop import into ID?

Votes

Translate

Translate

Report

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 ,
Apr 28, 2023 Apr 28, 2023

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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
Explorer ,
Apr 28, 2023 Apr 28, 2023

Copy link to clipboard

Copied

Thanks for the link, I created a script and got an error 

Votes

Translate

Translate

Report

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 ,
Apr 28, 2023 Apr 28, 2023

Copy link to clipboard

Copied

My bad. Should just be save, not saveAs. Been working in Photoshop scripting lately which uses a different func. 

Votes

Translate

Translate

Report

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
Explorer ,
Apr 28, 2023 Apr 28, 2023

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?

Votes

Translate

Translate

Report

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 ,
May 03, 2023 May 03, 2023

Copy link to clipboard

Copied

LATEST

Change this line:

docs[i].saveAs(File(fol + "/adoc_" + i));

as follows:

docs[i].saveAs(File(fol + "/adoc_" + i + ".indd"));

Votes

Translate

Translate

Report

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