B
bonus
Any users out there use Javascript for Scripting Photoshop? My
conditional is not working.
Thanks in Advance!
#target photoshop
app.bringToFront();
function fitImage(newImgSize,res) {
var doc = app.activeDocument;
if (res == undefined) res = undefined;
if (doc.width > doc.height) {
doc.resizeImage(new UnitValue(newImgSize,'px'), undefined,
res, ResampleMethod.BICUBIC);
} else
if (doc.width < doc.height) {
doc.resizeImage(undefined, new UnitValue(newImgSize,'px'),
res, ResampleMethod.BICUBIC);
} else
if (doc.width == doc.height) {
doc.resizeImage(new UnitValue(newImgSize,'px'), new
UnitValue(newImgSize,'px'), res, ResampleMethod.BICUBIC);
}
};
var doc = app.activeDocument;
if (doc.height > '1200px') {
fitImage (1800,300) //pixels - resolution
}
if (doc.width > '1200px') {
fitImage (1800,300) //pixels - resolution
}
else {
fitImage (900,300) //pixels - resolution
}
conditional is not working.
Thanks in Advance!
#target photoshop
app.bringToFront();
function fitImage(newImgSize,res) {
var doc = app.activeDocument;
if (res == undefined) res = undefined;
if (doc.width > doc.height) {
doc.resizeImage(new UnitValue(newImgSize,'px'), undefined,
res, ResampleMethod.BICUBIC);
} else
if (doc.width < doc.height) {
doc.resizeImage(undefined, new UnitValue(newImgSize,'px'),
res, ResampleMethod.BICUBIC);
} else
if (doc.width == doc.height) {
doc.resizeImage(new UnitValue(newImgSize,'px'), new
UnitValue(newImgSize,'px'), res, ResampleMethod.BICUBIC);
}
};
var doc = app.activeDocument;
if (doc.height > '1200px') {
fitImage (1800,300) //pixels - resolution
}
if (doc.width > '1200px') {
fitImage (1800,300) //pixels - resolution
}
else {
fitImage (900,300) //pixels - resolution
}