I wasn’t sure where to place this? Script or Drawing & Design
so I will place it here until someone points into the right direction
Does anyone know how I can make my script batch for Photoshop CS3
// Copyright 2002-2007. Adobe Systems, Incorporated. All rights reserved.
// Set the active layer to the last art layer of the active document, or the
// first if the last is already active.
//2008 Modified by Wesley Paisley
// A Script to Resize an image in proportion to its long or short side.
// enable double clicking from the Macintosh Finder or the Windows Explorer
#target photoshop
// in case we double clicked the file
app.bringToFront();
// debug level: 0-2 (0:disable, 1:break on error, 2:break at beginning)
// $.level = 0;
// debugger; // launch debugger on next line
// Save the current preferences
var startRulerUnits = app.preferences.rulerUnits
var startTypeUnits = app.preferences.typeUnits
var startDisplayDialogs = app.displayDialogs
// Set Adobe Photoshop CS3 to use pixels and display no dialogs
app.preferences.rulerUnits = Units.PIXELS
app.preferences.typeUnits = TypeUnits.PIXELS
app.displayDialogs = DialogModes.NO
// Initialise the user defined variables
// The user can enter their own values in the next three variables.
// To resize in proportion to either the long or short side,
// either the long_side or short_side variable should be set to ZERO
// After you amend these values, you should resave the script under
// a different name to reflect the amount.
// For example ResizeBatchImage_576x72.jsx
var long_side = 158;
var short_side = 0;
var dpi = 72;
// Initialise the fixed variables
var doc = app.activeDocument;
var width = doc.width.value;
var height = doc.height.value;
var proportion1;
var proportion2;
if(height>width){
scaleY();
}else {
scaleX();
}
/*function scaleX(){
newH1 = width*144/height;
doc.resizeImage(144,newH1,72,
ResampleMethod.BICUBICSMOOTHER);
if(height<158){
numH = 158-height;
newH = numH + height;
doc.resizeCanvas(144,158);
}
} */
function scaleY(){
newW1 =width*158/height;
doc.resizeImage(newW1,158,72,
ResampleMethod.BICUBICSMOOTHER);
if(newW1<144){
/*numW = 144-width;
newW = numW + width; */
doc.resizeCanvas(144,158);
}
}
// clean-up
/*app.preferences.rulerUnits = orig_ruler_units;
var doc = null*/
/*while (app.documents.length >=1){
// save and close
var i = "_lg";
var outputFolder = "../test";
//doc.saveAs(new File(outputFolder + i + ".jpg")LOWERCASE);
doc.close(SaveOptions.SAVECHANGES);
//fileClose(SaveOptions.SAVECHANGES);
}*/
//doc.close(SaveOptions.SAVECHANGES);
thanks in advance!