2 Replies Latest reply on Jun 7, 2010 10:31 PM by electriciris

    Photoshop auto save on to an network drive

    zskull87

      Is it possible to have it auto save onto the network drive in a new folder that's the same name as the file?

       

      Here's my code so far

       

      #target photoshop
       
      app.bringToFront();
       
      //for (var i = 0; i < 100; i++) {
           //var someCol = new SolidColor();
           //someCol.rgb.red = Math.round(Math.random()*255);
           //someCol.rgb.green = Math.round(Math.random()*255);
           //someCol.rgb.blue = Math.round(Math.random()*255);
          // app.backgroundColor = someCol;
          // docRef = app.documents.add(UnitValue(100,'px'), UnitValue(100,'px'), 72, 'Foo', NewDocumentMode.RGB, DocumentFill.BACKGROUNDCOLOR);
           // Add you commands here or Call an Action
           var outfolder = '//192.168.55.217/www/testimages/';
           createFolder(outfolder);
          // var serial = zeroPad(i+1, 3);
           var newFilePath = new File(outfolder + app.activeDocument.name + '.jpg');
             saveFileasJPEG(newFilePath, 12);
             //docRef.close(SaveOptions.DONOTSAVECHANGES);
      //}
       
      function saveFileasJPEG(saveFile, qL) {
        jpgSaveOptions = new JPEGSaveOptions();
        jpgSaveOptions.embedColorProfile = true;
        jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
        jpgSaveOptions.matte = MatteType.NONE;
        jpgSaveOptions.quality = qL;
        activeDocument.saveAs(saveFile, jpgSaveOptions, true, Extension.LOWERCASE);
      }
       
      function createFolder(Directory) {
        var folderPath = new Folder(Directory);
        if (folderPath.exists == false) folderPath.create();
      }
       
      function zeroPad(num, digit) {
        var tmp = num.toString();
        while (tmp.length < digit) {tmp = '0' + tmp;}
        return tmp;
      }
      

       

      Thanks in advance for your help.