// Photoshop CS script: // // Jim Elder, Ottawa, Dec 2004 // Save the current preferences var startRulerUnits = app.preferences.rulerUnits; var startTypeUnits = app.preferences.typeUnits; var startDisplayDialogs = app.displayDialogs; // Set Photoshop to use pixels and display no dialogs app.preferences.rulerUnits = Units.PIXELS; app.preferences.typeUnits = TypeUnits.PIXELS; app.displayDialogs = DialogModes.NO; // Start the script debugger // uncomment the line below to cause Photoshop to start its debugger at this point $.level = 1; debugger; if (confirm("Do you want the current document to be expanded?")) { var loops = prompt("How many times should it be expanded 10%?", 4); if (loops > 0) { if (loops > 10) loops = 10; while (loops-- > 0) { // resize the image by 10% app.activeDocument.resizeImage(app.activeDocument.width * 1.1, app.activeDocument.height * 1.1, app.activeDocument.resolution); } } } // Reset the application preferences app.preferences.rulerUnits = startRulerUnits; app.preferences.typeUnits = startTypeUnits; app.displayDialogs = startDisplayDialogs;