9 Replies Latest reply on Jan 10, 2017 4:28 PM by MikeGondek

    Save All Command

    MikeGondek Adobe Community Professional & MVP

      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.

        • 1. Re: Save All Command
          Silly-V Adobe Community Professional

          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[i].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.

          1 person found this helpful
          • 2. Re: Save All Command
            williamadowling Level 4

            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!"

            1 person found this helpful
            • 3. Re: Save All Command
              pixxxel schubser Level 5

              Hi MikeGondek,

              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

               

              1 person found this helpful
              • 4. Re: Save All Command
                williamadowling Level 4

                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.

                • 5. Re: Save All Command
                  pixxxel schubser Level 5

                  This case could be possible. But I do not understand the workflow. Perhaps the TO MikeGondek 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 …

                  • 6. Re: Save All Command
                    Silly-V Adobe Community Professional

                    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.

                    • 7. Re: Save All Command
                      MikeGondek Adobe Community Professional & MVP

                      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.

                      • 8. Re: Save All Command
                        MikeGondek Adobe Community Professional & MVP

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

                          }

                          }

                        }

                        • 9. Re: Save All Command
                          MikeGondek Adobe Community Professional & MVP

                          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.