4 Replies Latest reply on Jan 5, 2011 7:23 AM by c.pfaffenbichler

    Save all open images

    sharkcellar Level 1

      I didn't find this when I did a forum search, but I find it hard to believe that there isn't a feature request for this already. Photoshop needs a "Save All" feature. I've seen suggestion to just make this an action, but the problem with that is that you must continually hit the action in order to perform it. Maybe I'm just missing something but I find it odd that a photo editing program, in which it is quite possible that you could have dozens of images open at the same time has no "Save All" or "Autosave" features...still.

        • 1. Re: Save all open images
          c.pfaffenbichler Level 9

          Which version?

          CS5 offers an Apply to All-checkbox in the Save dialog when invoking Close All.

           

          Other than that I doubt that it lends itself to Actions well, a Script might be able to handle it better, especially if unsaved newly created documents are in the mix.

          • 2. Re: Save all open images
            c.pfaffenbichler Level 9

            If you want to give it a try paste the following text into a new file in ExtendScript Toolkit (part of Photoshop’s installation, Applications/Utilities/Adobe Utilities - CS5/ExtendScript Toolkit CS5) and save it as a jsx-file into Photoshop’s Presets/Scripts-folder.

            After restarting Photoshop the Script should be available under File > Scripts and can be assigned a Keyboard Shortcut directly, recorded into an Action, (in CS4 and CS5) be used in a Configurator-Panel or started from ExtendScript Toolkit directly.

             

             

            // save all open documents;
            // 2011, use it at your own risk;
            #target photoshop;
            if (app.documents.length > 0) {
            var theFirst = app.activeDocument;
            var theDocs = app.documents;
            // psd options for unsaved files;
            psdOpts = new PhotoshopSaveOptions();
            psdOpts.embedColorProfile = true;
            psdOpts.alphaChannels = false;
            psdOpts.layers = true;
            psdOpts.spotColors = true;
            // go through all files;
            for (var m = 0; m < theDocs.length; m++) {
                 var theDoc = theDocs[m];
                 app.activeDocument = theDoc;
            // getting the name and location;
                 var docName = theDoc.name;
            // thanks to xbytor for the regexp;
                 if (docName.indexOf(".") != -1) {var basename = docName.match(/(.*)\.[^\.]+$/)[1]}
                 else {var basename = docName};
            // getting the location, if unsaved save to desktop;
                 try {
                      var docPath = theDoc.path;
            // save the file if unsaved;
                      if (theDoc.saved == false) {theDoc.save()}
                      }
            // if file has not been saved yet save to desktop;
                 catch (e) {
                      var docPath = "~/Desktop";
                      theDoc.saveAs((new File(docPath+'/'+basename+".psd")), psdOpts, false, Extension.LOWERCASE);
                      };
                 };
            app.activeDocument = theFirst;
            };
            
            • 3. Re: Save all open images
              sharkcellar Level 1

              c.pfaffenbichler,

               

                Thanks for the tip! Though, I'm curious. Why the "use it at your own risk" caveat? What are the possible repercussion to using this? Is it only a warning that some things that I'm intending on trying to save might not be saved at all, or are there large system performance issues that using this could incur? Thanks again.

              • 4. Re: Save all open images
                c.pfaffenbichler Level 9
                Is it only a warning that some things that I'm intending on trying to save might not be saved at all, or are there large system performance issues that using this could incur? Thanks again.

                Not to the best of my knowledge – but my knowledge is not that terribly wide with Scripting.

                Scripts are supposedly only slightly more complex for Photoshop to run than Actions.

                The main issue I suspect is you might disturb the operation if you shift focus by clicking into a document window while the Script runs.

                And naturally if you work across a network that is risky in and of itself.

                 

                Anyway, I just don’t make any guarantees for my Scripting efforts.

                But if you want advice on Scripting (or a second opinion on this Script) feel free to ask in the Photoshop Scripting Forum:

                http://forums.adobe.com/community/photoshop/photoshop_scripting