16 Replies Latest reply on Mar 28, 2011 10:55 PM by c.pfaffenbichler

    Create folders in destop "Help Me"

    sasientry Level 1

      Hi guys

       

      I want create folder name "Save" in destop

       

      in this folder inside i want to seperate folder name "Low res" and "High Res"

       

      less than 800 pixels images i want save low res folder

       

      More then 800 pixels images i want save high res folder

        • 1. Re: Create folders in destop "Help Me"
          c.pfaffenbichler Level 9

          less than 800 pixels images i want save low res folder

           

          More then 800 pixels images i want save high res folder

          What exactly do you intend save-wise? Save copy of open files, which format, move the originals …?

           

          The folder-creation should be no problem, this may help you get started:

          var theFolder = Folder("~/Desktop/Save");
          if (theFolder.exists == false) {
               theFolder.create()
               }
          else {};
          

          • 2. Re: Create folders in destop "Help Me"
            sasientry Level 1

            save tiff format

            • 3. Re: Create folders in destop "Help Me"
              c.pfaffenbichler Level 9

              Save as copy, flattened, …?

              • 4. Re: Create folders in destop "Help Me"
                sasientry Level 1

                Hi guys

                 

                I want create folder name "Save" in destop

                 

                in this folder inside i want to seperate folder name "Low res" and "High Res"

                 

                less than 800 pixels images i want save low res folder

                 

                More then 800 pixels images i want save high res folder

                 

                Save tiff format

                 

                save Flatten images

                • 5. Re: Create folders in destop "Help Me"
                  c.pfaffenbichler Level 9

                  This would save as a copy, leaving the layered file unchanged:

                   

                  tifOpts = new TiffSaveOptions();
                  tifOpts.embedColorProfile = true;
                  tifOpts.imageCompression = TIFFEncoding.TIFFLZW;
                  tifOpts.alphaChannels = false;
                  tifOpts.byteOrder = ByteOrder.MACOS;
                  tifOpts.layers = false;
                  app.activeDocument.saveAs((new File("~/Desktop/Save/Low res/"+app.activeDocument.name+".tif")),tifOpts,true);
                  

                   

                  As for deciding on your target folder a simple if-clause (dependent on app.activeDocument.width and/or height) should be able to handle it.

                  Then adjust "~/Desktop/Save/Low res/" for the other case …

                  • 6. Re: Create folders in destop "Help Me"
                    sasientry Level 1

                    how i find out 800 pixel images

                     

                    i want only save lower than 800 pixels files are saved in low res folder

                     

                    bigger than 800 pixels images are saved in hires folder

                     

                    please help me from the begining

                    • 7. Re: Create folders in destop "Help Me"
                      c.pfaffenbichler Level 9

                      It’s not much different from other issues that you have asked about previously.

                       

                       

                      // use at your own risk; 
                      #target photoshop
                      // the folders;
                      var saveFolder = createFolder("~/Desktop/Save");
                      var lowFolder = createFolder("~/Desktop/Save/Low res");
                      var hiFolder = createFolder("~/Desktop/Save/High Res");
                      // set to pixels;
                      var originalRulerUnits = app.preferences.rulerUnits;
                      app.preferences.rulerUnits = Units.PIXELS;
                      // define file;
                      var myDocument = app.activeDocument;
                      var width = myDocument.width;
                      var height = myDocument.height;
                      // tif options;
                      tifOpts = new TiffSaveOptions();
                      tifOpts.embedColorProfile = true;
                      tifOpts.imageCompression = TIFFEncoding.TIFFLZW;
                      tifOpts.alphaChannels = false;
                      tifOpts.byteOrder = ByteOrder.MACOS;
                      tifOpts.layers = false;
                      // if smaller than 800 in both directions;
                      if (height < 800 && width < 800) {
                           myDocument.saveAs((new File(lowFolder+"/"+myDocument.name+".tif")),tifOpts,true)
                           }
                      else {
                           myDocument.saveAs((new File(hiFolder+"/"+myDocument.name+".tif")),tifOpts,true)
                           };
                      // reset;
                      app.preferences.rulerUnits = originalRulerUnits;
                      ////// create folder in not existant //////
                      function createFolder (thePath) {
                           var theFolder = Folder(thePath);
                           if (theFolder.exists == false) {theFolder.create()};
                           return(theFolder)
                           };
                      1 person found this helpful
                      • 8. Re: Create folders in destop "Help Me"
                        sasientry Level 1

                        Hi c.pfaffenbichler,

                         

                         

                        This script is Working now

                         

                        But i have One Problem

                         

                        when save this images the extention was came like this way

                         

                        _Y8F2219.jpg (Source image)

                         

                        _Y8F2219.JPG.tif (Output file)

                         

                        i dont want .Jpg.tif

                         

                        i only want

                         

                        _Y8F2219.tif

                         

                        this type  of extension

                        • 9. Re: Create folders in destop "Help Me"
                          c.pfaffenbichler Level 9

                          You can amend that by for example using »slice« to cut the name.

                           

                          myDocument.name.slice(0, x)

                           

                          Just decide on an appropriate way to determine x, either in relation to myDocument.name.length or by the index of (a part of) ».JPG«.

                          • 10. Re: Create folders in destop "Help Me"
                            sasientry Level 1

                            sorry i cant understand this script

                             

                            pls give me good solution

                            • 11. Re: Create folders in destop "Help Me"
                              c.pfaffenbichler Level 9

                              var name = myDocument.name.slice(0,myDocument.name.lastIndexOf("."));
                              if (height < 800 && width < 800) {      myDocument.saveAs((new File(lowFolder+"/"+name+".tif")),tifOpts,true)      } else {      myDocument.saveAs((new File(hiFolder+"/"+name+".tif")),tifOpts,true)      };

                              1 person found this helpful
                              • 12. Re: Create folders in destop "Help Me"
                                sasientry Level 1

                                hi

                                 

                                please sorry about disturb You

                                 

                                 

                                (Adobe Photoshop.tif) when i rus this script  i have this name

                                 

                                i want source file name whatever is there

                                 

                                i dont want create another name

                                 

                                and extension i need (.tif)

                                 

                                i dont want (.psd.tif, .jpg.tif) like two extension after source name

                                • 13. Re: Create folders in destop "Help Me"
                                  c.pfaffenbichler Level 9

                                  Does this work?

                                   // use at your own risk; 
                                  #target photoshop
                                  // the folders;
                                  var saveFolder = createFolder("/Pfaffi 1.5TB/wegwerfen/Save");
                                  var lowFolder = createFolder("/Pfaffi 1.5TB/wegwerfen/Save/Low res");
                                  var hiFolder = createFolder("/Pfaffi 1.5TB/wegwerfen/Save/High Res");
                                  // set to pixels;
                                  var originalRulerUnits = app.preferences.rulerUnits;
                                  app.preferences.rulerUnits = Units.PIXELS;
                                  // define file;
                                  var myDocument = app.activeDocument;
                                  var width = myDocument.width;
                                  var height = myDocument.height;
                                  // tif options;
                                  tifOpts = new TiffSaveOptions();
                                  tifOpts.embedColorProfile = true;
                                  tifOpts.imageCompression = TIFFEncoding.TIFFLZW;
                                  tifOpts.alphaChannels = false;
                                  tifOpts.byteOrder = ByteOrder.MACOS;
                                  tifOpts.layers = false;
                                  // if smaller than 800 in both directions;
                                  if (height < 800 && width < 800) {
                                       myDocument.saveAs((new File(lowFolder+"/"+myDocument.name.slice(0,myDocument.name.length - 4)+".tif")),tifOpts,true)
                                       }
                                  else {
                                       myDocument.saveAs((new File(hiFolder+"/"+myDocument.name.slice(0,myDocument.name.length - 4)+".tif")),tifOpts,true)
                                       };
                                  // reset;
                                  app.preferences.rulerUnits = originalRulerUnits;
                                  ////// create folder in not existant //////
                                  function createFolder (thePath) {
                                       var theFolder = Folder(thePath);
                                       if (theFolder.exists == false) {theFolder.create()};
                                       return(theFolder)
                                       };
                                  

                                  • 14. Re: Create folders in destop "Help Me"
                                    sasientry Level 1

                                    thanks man now its work

                                    • 15. Re: Create folders in destop "Help Me"
                                      JJMack Most Valuable Participant

                                      And I think you owe c.pfaffenbichler a case of wine....

                                      • 16. Re: Create folders in destop "Help Me"
                                        c.pfaffenbichler Level 9

                                        No thanks to the wine, no big friend of the stuff …

                                        I had hoped sasientry would be able to piece the elements together, therefore I offered them in this fractured fashion … which prolonged the communication somewhat.