VI.iii Saving All Of Your Documents Instantly
Taking JPG snapshots and putting them in a new directory

This very simple script will take a 'snapshot' of your workspace; all of the documents opened will be saved as JPGs in a new directory.

Download .js code PS7 / CS
(right click and 'save as')



Even though we tell Photoshop to 'create' a new folder, a folder with the existing name will not get erased; in that case files will simply be added to it one after another.
Extra note: here the folder created will be "C:\PSTemp\" for Windows and Desktop>PSTemp for Macs.

var tempFolder = new Folder ("//PSTemp")

var DL = documents.length;


   activeDocument = documents[a-1];
   var AD=activeDocument;
   var imgName=;
   imgName = imgName.substr(0, imgName.length -4);

   //saving as jpg - check out other example scripts / reference to check out other file formats
   saveFile = new File("//PSTemp/"+imgName+".jpg");
   saveOptions = new JPEGSaveOptions();
   saveOptions.embedColorProfile = true;
   saveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
   saveOptions.matte = MatteType.NONE;
   saveOptions.quality = 12; //ranges from 0 to 12
   AD.saveAs(saveFile, saveOptions, true,Extension.LOWERCASE);



Now you can keep a Photoshop temporary directory and dump snapshots of your current work in it. (To speed up the thing, bind a key to this script via an Action). Don't forget you can modify this code extensively; you can for example:

  • Tell Photoshop to save the current document in its current location
  • Save the file in its original format (PSD, JPG, TIFF, BMP etc...)
  • Save the file a quarter of its original size
  • Set a specific filename
  • Set a text date/marker on your image
  • and more... !

On to our fourth sample code: Comparing the saving qualities of JPGs

 page 8 / 11