// cropAndStraighten.jsx // Copyright 2006-2008 // Written by Jeffrey Tranberry // Photoshop for Geeks Version 2.0 /* Description: This script demonstates how create a function for Crop and Straighten using the ScriptingListener plug-in You must have an open document in order for this script to run */ // 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(); ///////////////////////// // MAIN ///////////////////////// // Create a variable to store a reference to // the currently active document, which in this // case is the parent document we want to extract // multiple scanned images from var docRef = app.activeDocument; // Run the cropAndStraighten function // which will rusult in more than one open document cropAndStraighten(); // Close the parent document we originally opened docRef.close(SaveOptions.DONOTSAVECHANGES); ///////////////////////// // FUNCTIONS ///////////////////////// // Crop and Straighten function created // using the ScriptingListener plug-in function cropAndStraighten(){ var id333 = stringIDToTypeID( "CropPhotosAuto0001" ); executeAction( id333, undefined, DialogModes.NO ); }