3 Replies Latest reply on Aug 28, 2017 11:28 PM by Stephen_A_Marsh

    Trouble with naming files when saving

    parseeker

      I recently switched to Photoshop CC 2017 from CS6.  When I am working on an image I often end up saving several different versions as I go along and typically just add a 1, 2, 3 etc. to the end of the file name so they don't overwrite one another.  CS6 would change the name of the image each time I saved a new version so that I was always working on the most recent one.  CC 2017, however, keeps reverting the file name back to the original without any numbers which makes me lose track of what number save I'm on and occasionally to overwrite files by accident. 

       

      Is there anyway to change the way the filename shows up so that it works the same as it did in CS6?  I realize this might be a problem unique to the work I do, but appreciate any help.

        • 1. Re: Trouble with naming files when saving
          Stephen_A_Marsh Adobe Community Professional

          Not an exact attempt to directly answer your question… however a script to save an incrementally named JPEG copy of the source image can be found here:

           

          How to incrementally save images using a hotkey

           

          Filename.psd

          Filename_001.jpg

          Filename_002.jpg

          etc…

           

          It should be “easy enough” to hack the script into saving a different file format, such as PSD, TIFF etc.

          1 person found this helpful
          • 2. Re: Trouble with naming files when saving
            Stephen_A_Marsh Adobe Community Professional

            Here is a copy of the incremental JPEG save script that I just hacked into saving out a PSD file:

             

            // https://forums.adobe.com/message/4453915#4453915
            #target photoshop
            main();
            function main(){
            if(!documents.length) return;
            var Name = app.activeDocument.name.replace(/\.[^\.]+$/, '');
            try{
            var savePath = activeDocument.path;
            }catch(e){
                alert("You must save this document first!");
                }
            var fileList= savePath.getFiles(Name +"*.psd").sort().reverse();
            var Suffix = 0;
            if(fileList.length){
                Suffix = Number(fileList[0].name.replace(/\.[^\.]+$/, '').match(/\d+$/));
            }
            Suffix= zeroPad(Suffix + 1, 3);
            var saveFile = File(savePath + "/" + Name + "_" + Suffix + ".psd");
            SavePSD(saveFile);
            }
            function SavePSD(saveFile){   
            // http://jongware.mit.edu/pscs5js_html/psjscs5/pc_PhotoshopSaveOptions.html
            psdSaveOptions = new PhotoshopSaveOptions();   
            psdSaveOptions.embedColorProfile = true;   
            psdSaveOptions.alphaChannels = true;    
            psdSaveOptions.layers = true;
            psdSaveOptions.annotations = true;
            psdSaveOptions.spotColors = true;
            activeDocument.saveAs(saveFile, psdSaveOptions, true, Extension.LOWERCASE);   
            }; 
            function zeroPad(n, s) { 
               n = n.toString(); 
               while (n.length < s)  n = '0' + n; 
               return n; 
            };
            
            1 person found this helpful
            • 3. Re: Trouble with naming files when saving
              Stephen_A_Marsh Adobe Community Professional

              Here is a copy of the incremental JPEG save script that I just hacked into saving out a TIFF file:

               

              // https://forums.adobe.com/message/4453915#4453915
              #target photoshop
              main();
              function main(){
              if(!documents.length) return;
              var Name = app.activeDocument.name.replace(/\.[^\.]+$/, '');
              try{
              var savePath = activeDocument.path;
              }catch(e){
                  alert("You must save this document first!");
                  }
              var fileList= savePath.getFiles(Name +"*.tif").sort().reverse();
              var Suffix = 0;
              if(fileList.length){
                  Suffix = Number(fileList[0].name.replace(/\.[^\.]+$/, '').match(/\d+$/));
              }
              Suffix= zeroPad(Suffix + 1, 3);
              var saveFile = File(savePath + "/" + Name + "_" + Suffix + ".tif");
              SaveTIFF(saveFile);
              }
              function SaveTIFF(saveFile){ 
              // http://jongware.mit.edu/pscs5js_html/psjscs5/pc_TiffSaveOptions.html
              // http://jongware.mit.edu/pscs5js_html/psjscs5/pe_TIFFEncoding.html
              // TIFFEncoding.NONE
              // TIFFEncoding.JPEG
              // TIFFEncoding.TIFFLZW
              // TIFFEncoding.TIFFZIP
              tiffSaveOptions = new TiffSaveOptions(); 
              tiffSaveOptions.embedColorProfile = true; 
              tiffSaveOptions.byteOrder = ByteOrder.IBM; 
              tiffSaveOptions.transparency = true;
              tiffSaveOptions.layers = true;
              tiffSaveOptions.layerCompression = LayerCompression.ZIP;
              tiffSaveOptions.interleaveChannels= true; 
              tiffSaveOptions.alphaChannels = true;
              tiffSaveOptions.spotColors = true;
              tiffSaveOptions.imageCompression = TIFFEncoding.TIFFLZW; 
              activeDocument.saveAs(saveFile, tiffSaveOptions, true, Extension.LOWERCASE); 
              }; 
              function zeroPad(n, s) {
                n = n.toString();
                while (n.length < s)  n = '0' + n;
                return n;
              };