For the past year I've benefitted greatly from a script I developed with the invaluable help of Mike, Patrick and Xbytor.
Recently I upgraded to 64-bit PS CS5 (from CS3) and changed O/S from XP to Windows 7..... ...and the script now stops before completing the tasks.
BACKGROUND: In my workflow I begin by working with a DNG file (16-bit) in Photoshop.... adding layers and whatever..... When I've finished working on the image my script will 1) flatten the image, 2) convert to 8-bit and 3) save the image as a jpg in the same folder as the original DNG file, and using the same file name except that the new file has a suffix added to the file name, and close the file.
It's the step #3 that has stopped working for me. I suspect that the 'jpgSaveOptions' have changed but I don't know where to look to find them.
Here is the full script
Code: Select all//Bob Acton. November 3, 2009. Last updated August 22, 2010.
//Script to process a single image which is already open in CS5. Do the following:
// -flatten image
// -convert to 8-bit mode
// -SaveAs JPEG in high quality (10, or as set in script below) and
// filename suffix (specified in script)
// NOTE: This script was developed with assistance from Mike, Patrick
// and Xbytor at www.PS-Scripts.com
//-------------------------------------------------------------
//
//1. Flatten Image =======================================
var id12 = charIDToTypeID( "FltI" );
executeAction( id12, undefined, DialogModes.NO );
//2. Convert to 8-bit mode ===============================
var id13 = charIDToTypeID( "CnvM" );
var desc4 = new ActionDescriptor();
var id14 = charIDToTypeID( "Dpth" );
desc4.putInteger( id14, 8 );
executeAction( id13, desc4, DialogModes.NO );
//3. Script to perform SAVEAS function//////////////////////////////////////////
// Usage: SaveAs function on existing open and active document in CS5
// Input: full name (path + filename) for the jpg
///////////////////////////////////////////////////////////////////////////////
// your active document
var doc = app.activeDocument;
// save as jpeg with suffix. eg. "-processedHiRes.jpg"
var jpgQuality = 8;
var saveFile = doc.path + "/" + doc.name.replace(/\.[^\.]+$/, '') + "-ScrRes.jpg";
SaveJPEG( new File(saveFile), jpgQuality );
function SaveJPEG(saveFile, jpegQuality){
jpgSaveOptions = new JPEGSaveOptions();
jpgSaveOptions.embedColorProfile = true;
jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
jpgSaveOptions.matte = MatteType.NONE;
jpgSaveOptions.quality = jpegQuality;
activeDocument.saveAs(saveFile, jpgSaveOptions);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}
Any assistance would be much appreciated. Thanks people.
BA.
Update SaveAs script for CS5
Update SaveAs script for CS5
Try saving the file to your desktop instead of the same directory as the dng. If that works, the permissions on the dng folder won't let you save new files.
Update SaveAs script for CS5
Thank you xbytor.
Yes, as you thought, the script is fine..... .....it was something stupid that I was doing. I now have all my CS3 scripts running in CS5 (64-bit) with the new O/S (Windows 7). Life is great!!
Thanks again for your feedback.
BA.
Yes, as you thought, the script is fine..... .....it was something stupid that I was doing. I now have all my CS3 scripts running in CS5 (64-bit) with the new O/S (Windows 7). Life is great!!
Thanks again for your feedback.
BA.