Flash Components      Flash Menu      Flash Gallery      Flash Slideshow      FLV Player      Flash Form      MP3 Player      PhotoFlow      Flash CMS      3D Wall      Flash Scroller

 

 

 

 

 
PhotoShop
Scripting
        by mlk : Hot Summer Month of 2004

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')

 

Note
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")
tempFolder.create();

var DL = documents.length;

for(a=1;a<=DL;a++){

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

   //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);
}

 

Tip
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 of 11


 




SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple.