3 Replies Latest reply on Aug 11, 2011 10:52 PM by JJJJJJLiu

    Help: Save as jpeg


      Maybe someone can help me on this Photoshop script, or action. I am working on a psd file  with few layers in Photoshop CS4.  I would like to save it to the jpeg  format.


      Below is my workflow.
      1) Drag and drop 01.psd into Photoshop from A folder.
      2) Save 01.psd to 01.jpeg into the A folder.
      3) Image options with quality, "5" Medium.
      4) Format Options with Baseline ("Standard")
      5) Image mode is in RGB color.
      6) Use lower case extension.
      7) Other options should be in default setting.


      The script or action should be able to:
      1) Save as jpeg format with similar name as the psd file without adding words or marks such as "copy" or "-".
      2)  Save as jpeg format with similar name as the psd file, and able to  overwrite the jpeg file whenever the psd file has been updated and saved  multiple times.
      3) Save the jpeg file into the same folder as the source file without creating any subfolder.
      4) Not close the psd file, but still keeping it opens in the Photoshop without any changes.


      I've tried the script from http://www.russellbrown.com, and Image Processor from Photoshop CS4, but those are not exactly what I want.


      Please help, thanks.

        • 1. Re: Help: Save as jpeg
          c.pfaffenbichler Level 9

          Would this help?

          Converting non-RGB-files to RGB would need an additional step, but would not be hard to include.


          // saves jpg into same folder;
          // be advised: this  overwrites existing jpgs of the same name without prompting. 
          // 2011, use it at your own risk;
          #target photoshop;
          if (app.documents.length > 0) {
          var thedoc = app.activeDocument;
          // getting the name and location;
          var docName = thedoc.name;
          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}
          catch (e) {var docPath = "~/Desktop"};
          // jpg options;
          var jpegOptions = new JPEGSaveOptions();
          jpegOptions.quality = 5;
          jpegOptions.embedColorProfile = true;
          jpegOptions.matte = MatteType.NONE;
          //save jpg as a copy:
          thedoc.saveAs((new File(docPath+'/'+basename+'.jpg')),jpegOptions,true);
          //that’s it; thanks to xbytor;

          • 2. Re: Help: Save as jpeg
            JJMack Most Valuable Participant

            I think a simple "Savs As" jpeg action should be able to do that for you. Create that simple action. perhaps first step edit convert to profile sRGB then save as jpeg quality 5.Then in the Bridge select all the PSD files you want to save as jpeg then use menu Tools>Photoshop>Batch....  Then in the Batch Dialog select your action, source bridge, Desternation folder, choose a folder where you want the output stored in the same folder or else where, check Override Save As step. OK to run.... When you play that action on a PSD file in a non batch the PSD will remain Open.  The Batch Processor however will close the PSD tile. If you want the jpeg file replaced over written if it exists. Then before you create the action save a jpeg file so when you record the Save As jpeg your reply to the overwrite prompt will get recorded into the action. Not when recording the SAVE AS step do not change anything related to file name record the default setting Photoshop put in there. Batch will overridre there.

            • 3. Re: Help: Save as jpeg
              JJJJJJLiu Level 1

              Wow! It works! Thank you very much! You just saved my life.