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

Save All Command

Community Expert ,
Jan 10, 2017 Jan 10, 2017

Copy link to clipboard

Copied

Is there a secret command or is this possible with scripting to make a save all open documents?

Many of us in the graphics arts/printing world have edits to make and this would be very useful. For example I have 6 baking mixes which need updating, and I update the job slug on each one of the six file with date, my initials, versions number. After that would like to save all with 1 command.

Screen Shot 2017-01-10 at 12.13.09 PM.png

Even more than the time saving benefit , is the reduction of errors and remembering did I do this revision.

I  suggested this and many other suggestions over the years, but seems Adobe is letting anyone in the betas  and  are buried by suggestions of changing menus and icons rather than providing anything significantly useful to the creative or production anymore. So I turn to the Illustrator scripting forum, the last hope for seeing anything interesting.

TOPICS
Scripting

Views

4.3K

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

correct answers 1 Correct answer

Valorous Hero , Jan 10, 2017 Jan 10, 2017

Try this one!

 

#target illustrator

function test(){

 

  for(var i=0; i<app.documents.length; i++){

    app.documents[i].activate();

    app.activeDocument.save();

  };

 

};

test();

 

oddly enough,     app.documents.save(); does not work - it's got to be the 'activeDocument'

 

Yes, this forum is a festering laboratory of creative and outrageous minds yet. Always something mythical and interesting abrew.

Votes

Translate

Translate
Adobe
Valorous Hero ,
Jan 10, 2017 Jan 10, 2017

Copy link to clipboard

Copied

Try this one!

 

#target illustrator

function test(){

 

  for(var i=0; i<app.documents.length; i++){

    app.documents[i].activate();

    app.activeDocument.save();

  };

 

};

test();

 

oddly enough,     app.documents.save(); does not work - it's got to be the 'activeDocument'

 

Yes, this forum is a festering laboratory of creative and outrageous minds yet. Always something mythical and interesting abrew.

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 ,
Jan 10, 2017 Jan 10, 2017

Copy link to clipboard

Copied

man. i've been pulling my hair out trying to provide an answer to this question and have not been able to get app.documents[index].save() to work.

ugh. so frustrating. It just repeatedly says "you must provide a file path". and i'm screaming (internally) at my monitor "I GAVE YOU AN EFFING FILE PATH! JUST SAVE THE EFFING FILE! EFFING EFF!"

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
New Here ,
Mar 12, 2021 Mar 12, 2021

Copy link to clipboard

Copied

Where do you put this line of code? Does it work for mac and windows?

Thanks

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 ,
Mar 12, 2021 Mar 12, 2021

Copy link to clipboard

Copied

copy the code, paste in a plain text file, save it as "/full_path/nameOfYourChoice.jsx"

 

then go to Illustrator, File->Scripts->Other Scripts...to navigate to your script

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
New Here ,
Jun 29, 2021 Jun 29, 2021

Copy link to clipboard

Copied

Thank you so much! It's working.

 

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
New Here ,
Jun 29, 2021 Jun 29, 2021

Copy link to clipboard

Copied

It's working (2021 06 29). Thank you so much!

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
New Here ,
Aug 16, 2023 Aug 16, 2023

Copy link to clipboard

Copied

LATEST

This was working just fine in 2022 & 2023, until I updated to the newest build, and then it broke for me in 2023, and kept telling me I didn't have a file path (seems like the exact opposite problem to @Disposition_Dev; I kept yelling at my screen, "I'm not giving you a file path! You don't NEEEED the file path!!").

 

Anyway, I WAS able to make it work by switching it to this:

#target illustrator

function saveAllOpen(){
  for(var i=0; i<app.documents.length; i++){
    app.documents[i].save();

    //removed the following:
    //app.documents[i].activate();
    //app.activeDocument.save();
  };
};

saveAllOpen();

 

Good luck, y'all!

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 ,
Jan 10, 2017 Jan 10, 2017

Copy link to clipboard

Copied

Hi Mike Gondek2​,

if I understand you right, try this:

var allDocs = app.documents;

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

    if (allDocs[i].path != "") {

    if (!allDocs[i].saved) {allDocs[i].close(SaveOptions.SAVECHANGES);}

    else { allDocs[i].close();}

    }

}

 

Have fun

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 ,
Jan 10, 2017 Jan 10, 2017

Copy link to clipboard

Copied

I considered providing this approach, but my guess was he wanted to keep the files open. This is the approach i typically use because, personally, when i save a file, i'm done with it. But i know of many people who have workflows that require leaving files open while certain changes are made.

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 ,
Jan 10, 2017 Jan 10, 2017

Copy link to clipboard

Copied

This case could be possible. But I do not understand the workflow. Perhaps the TO Mike Gondek2​ explain in detail.

Save a file always overwrite the existing file. Making changes and save again with the same name (and path) will overwrite the original file again.

IMHO it could be

better to saveAs or

working with template files or

make the changes with a script (eg with dialog) and save or or or …

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
Valorous Hero ,
Jan 10, 2017 Jan 10, 2017

Copy link to clipboard

Copied

It can be that he changes each file a little bit all through the day and wants to save all periodically without closing files, who knows.

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 ,
Jan 10, 2017 Jan 10, 2017

Copy link to clipboard

Copied

Yes I would like to keep the files open, to continue editing, and save over the files I have open.

Silly-V's javascript worked on a test I did. Cannot wait to use this when I get to  ice cream, 11 flavors and 4 suppliers. Would be nice if Adobe added a menu option to Save All, but will try to make an action for this to reduce clickstream and assign a hot key.

Also do any of you know about  the asterisk after the .ai in the filename works. I know you get the asterisk when you make a change to the file, but occasionally I open a file and get the asterisk even though no changes are made. I suspect this may have to do with fonts getting auto activated where something differs there that the postscript name, and of course if linked images are updated automatically.

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 ,
Jan 10, 2017 Jan 10, 2017

Copy link to clipboard

Copied

Feeling bad now as I actually already had a script by Wolfgang Reszel in my collection. Adobe just causes so much stress as we all in  professional environment have similar feature requests and the Illustrator especially gets slightly worse with every update.

 

 

//////////////////////////////////////////////////////////// english //

// --------------------------

// -=> WR-SaveAndCloseAll <=-

// --------------------------

//

// A Javascript for Adobe Illustrator

// by Wolfgang Reszel (ai-js@rumborak.de)

//

// Version 0.2 from 5.8.2003

//

// This script saves and closes all open documents.

//

// To enable the english messages change the "de" into "en" in line 40.

//

// Sorry for my bad english. For any corrections send an email to:

// ai-js@rumborak.de

//

//////////////////////////////////////////////////////////// Deutsch //

// --------------------------

// -=> WR-SaveAndCloseAll <=-

// --------------------------

//

// Ein Javascript fuer Adobe Illustrator

// von Wolfgang Reszel (ai-js@rumborak.de)

//

// Version 0.2 vom 5.8.2003

//

// Dieses Skript speichert und schliesst alle offenen Dokumente.

//

// Um dieses Skript mit deutschen Meldungen zu versehen, muss in Zeile

// 40 das "en" durch ein "de" ersetzt werden.

//

// Verbesserungsvorschlaege an: ai-js@rumborak.de

//

 

//$.bp();

 

// -------------------------------------------------------------------

 

var language="en"; // "de" fuer Deutsch

 

// -------------------------------------------------------------------

 

var WR="WR-SaveAndCloseAll v0.2\n\n";

 

if (language == "en") {

 

  var MSG_nodocs = WR+"Kein Dokument ge\xF6ffnet.";

  var MSG_ask = WR+"Sollen alle Dokumente gespeichert und geschlossen werden?";

 

} else {

 

  var MSG_nodocs = WR+"You have no open document."

  var MSG_ask = WR+"Are you sure to save and close all open documents?";

}

 

var itemstoprocess=0;

var error=0;

var Docs=documents.length;

 

if (Docs<1) {

  error++;

  alert(MSG_nodocs);

} else {

  if(confirm(MSG_ask)) {

  for(var i=0;i<Docs;i++) {

  documents[i].save();

  }

  }

}

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
LEGEND ,
Mar 12, 2021 Mar 12, 2021

Copy link to clipboard

Copied

@Mike_Gondek I hear you about AI slipping with each version. I've felt that way since about CS5. But I've found a new passion for Illustrator through learning ExtendScript (JavaScript). 

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 ,
Jan 10, 2017 Jan 10, 2017

Copy link to clipboard

Copied

In packaging design we have various flavors or products in the same brand line which must have consistency and go to client review and print that way or else you are out looking for a new job. I imagine this is true in many other industries from cartography to web design.

Though I would love to work on only 1 file at a time and do all the changes, it gets very complex writing notes about kerning values, copy changes, color changes, position shifts etc. So for consistency is best to work out one issue, how to handle that, apply that to all items as you may find what works on all but one flavor because that one has a longer flavor name or a claim or date code area in the way.

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