// saveAllOpenDocuments.jsx // Copyright 2006-2008 // Written by Jeffrey Tranberry // Photoshop for Geeks Version 2.0 /* Description: This script saves all the currently open documents as JPEGs and then closes them. */ // enable double clicking from the // Macintosh Finder or the Windows Explorer #target photoshop // Make Photoshop the frontmost application // in case we double clicked the file app.bringToFront(); ///////////////////////// // SETUP ///////////////////////// ///////////////////////// // MAIN ///////////////////////// // Process all open documents until no documents // are left open. while (app.documents.length >=1){ ///////////////////////// // Put all your processing functions... ///////////////////////// // Flatten the document in case the file type we want to save to requires a flat doc app.activeDocument.flatten(); //Save as a JPEG to the users desktop var jpegOptions = new JPEGSaveOptions(); jpegOptions.quality = 10; jpegOptions.embedColorProfile = false; app.activeDocument.saveAs( File( Folder.desktop + "/" + activeDocument.name.slice(0, -4) + ".jpg"), jpegOptions, false); // Close without saving app.activeDocument.close(SaveOptions.DONOTSAVECHANGES); ///////////////////////// // ...in the area between these two comments. ///////////////////////// } ///////////////////////// // FUNCTIONS /////////////////////////