2 Replies Latest reply: May 9, 2009 11:54 PM by Zeno Bokor RSS

    Bridge CS4 - Image processing into subfolders

    Petrula Community Member

      Design Premium CS4

      Bridge 3.0.0.464

      XP Pro SP3

       

      Problem: Image processing into subfolders

       

      I have a folder with several subfolders containing JPG files.

      I want to reduce the file size by reducing the quality.

      I use the following to do this:

      Tools | Photoshop | Image Processor

       

      Bridge doesn't appear to have the smarts to traverse down into the subfolders i.e. one has to do each folder individually.

       

      Is there a way to have Bridge image process down into the subfolders? Thanks in advance.

        • 1. Re: Bridge CS4 - Image processing into subfolders
          Paul Riggott Community Member

          This is a job for Photoshop not Bridge, Bridge can not alter the JPEG settings.

           

          This Photoshop script should do what you want if you are talking about normal JPEGS and not Save for Web.

           

          #target photoshop

          var imageFolder = Folder.selectDialog("Select the folder with JPGs to process " + $.getenv("username"));
          var quality = prompt("PLease enter quality required 1-12 ",5);
          if (imageFolder != null)  processFolder(imageFolder);
          function processFolder(folder) {
              var fileList = folder.getFiles()
               for (var i = 0; i < fileList.length; i++) {
                  var file = fileList[i];
            if (file instanceof File && file.name.match(/\.jpg$/i)) {
             open(file);
          saveFile(quality);
          app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);  
            } else
          if (file instanceof Folder) {
                 processFolder(file);
               }
             }
          }
          function saveFile(quality){
          saveOptions = new JPEGSaveOptions();
          saveOptions.embedColorProfile = true;
          saveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
          saveOptions.matte = MatteType.NONE;
          saveOptions.quality = quality;  
          var fileRef = new File(decodeURI(activeDocument.fullName.fsName));
          activeDocument.saveAs(fileRef,saveOptions);
          }

          • 2. Re: Bridge CS4 - Image processing into subfolders
            Zeno Bokor CommunityMVP

            When choosing that command from Bridge it will only work on the selected files so you have to either view all the files from the subfolders by going to View->Show Items from Subfolders and then selecting all the images or by choosing the command from Photoshop as then you can select a folder which you want to process and it also gives you the option to process all the subfolders