doc = app.activeDocument;
var savedState = app.activeDocument.activeHistoryState
// get a reference to the current (active) document and store it in a variable named "doc"
// these are our values for the END RESULT width and height (in pixels) of our image
var fWidth = 1155;
var fHeight = 1471;
// do the resizing. if height > width (portrait-mode) resize based on height. otherwise, resize based on width
activeDocument = doc;
if (doc.height > doc.width) {
doc.resizeImage(null,UnitValue(fHeight,"px"),null,ResampleMethod.BICUBIC);
}
else {
doc.resizeImage(UnitValue(fWidth,"px"),null,null,ResampleMethod.BICUBIC);
}
// Makes the default background white
var white = new SolidColor();
white.rgb.hexValue = "FFFFFF";
app.backgroundColor = white;
// 2012, use it at your own risk;
#target photoshop
if (app.documents.length > 0) {
activeDocument = doc;
var cwidth = 2000;
var cheight = 2000;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
doc.resizeCanvas(cwidth, cheight, AnchorPosition.MIDDLECENTER)
app.preferences.rulerUnits = originalRulerUnits;
};
// our web export options
var options = new ExportOptionsSaveForWeb();
options.quality = 70;
options.format = SaveDocumentType.JPEG;
options.optimized = true
var newName = 'MIR'+doc.name +'-22_28'+'.jpg';
doc.exportDocument(File(doc.path+'/'+newName),ExportType.SAVEFORWEB,options);
app.activeDocument.activeHistoryState = savedState
// these are our values for the END RESULT width and height (in pixels) of our image
var hWidth = 1141;
var hHeight = 1711;
// do the resizing. if height > width (portrait-mode) resize based on height. otherwise, resize based on width
activeDocument = doc;
if (doc.height > doc.width) {
doc.resizeImage(null,UnitValue(hHeight,"px"),null,ResampleMethod.BICUBIC);
}
else {
doc.resizeImage(UnitValue(hWidth,"px"),null,null,ResampleMethod.BICUBIC);
}
// Makes the default background white
var white = new SolidColor();
white.rgb.hexValue = "FFFFFF";
app.backgroundColor = white;
// 2012, use it at your own risk;
#target photoshop
if (app.documents.length > 0) {
activeDocument = doc;
var cwidth = 2000;
var cheight = 2000;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
doc.resizeCanvas(cwidth, cheight, AnchorPosition.MIDDLECENTER)
app.preferences.rulerUnits = originalRulerUnits;
};
// our web export options
var options = new ExportOptionsSaveForWeb();
options.quality = 70;
options.format = SaveDocumentType.JPEG;
options.optimized = true;
var newName = 'MIR'+doc.name+'-24_36'+'.jpg';
doc.exportDocument(File(doc.path+'/'+newName),ExportType.SAVEFORWEB,options);
app.activeDocument.activeHistoryState = savedState
// these are our values for the END RESULT width and height (in pixels) of our image
var fWidth = 1058;
var fHeight = 1897;
// do the resizing. if height > width (portrait-mode) resize based on height. otherwise, resize based on width
activeDocument = doc;
if (doc.height > doc.width) {
doc.resizeImage(null,UnitValue(fHeight,"px"),null,ResampleMethod.BICUBIC);
}
else {
doc.resizeImage(UnitValue(fWidth,"px"),null,null,ResampleMethod.BICUBIC);
}
// Makes the default background white
var white = new SolidColor();
white.rgb.hexValue = "FFFFFF";
app.backgroundColor = white;
// 2012, use it at your own risk;
#target photoshop
if (app.documents.length > 0) {
activeDocument = doc;
var cwidth = 2000;
var cheight = 2000;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
doc.resizeCanvas(cwidth, cheight, AnchorPosition.MIDDLECENTER)
app.preferences.rulerUnits = originalRulerUnits;
};
// our web export options
var options = new ExportOptionsSaveForWeb();
options.quality = 70;
options.format = SaveDocumentType.JPEG;
options.optimized = true;
var newName = 'MIR'+doc.name+'-24_43'+'.jpg';
doc.exportDocument(File(doc.path+'/'+newName),ExportType.SAVEFORWEB,options);
app.activeDocument.activeHistoryState = savedState
// these are our values for the END RESULT width and height (in pixels) of our image
var fWidth = 1360;
var fHeight = 1813;
// do the resizing. if height > width (portrait-mode) resize based on height. otherwise, resize based on width
activeDocument = doc;
if (doc.height > doc.width) {
doc.resizeImage(null,UnitValue(fHeight,"px"),null,ResampleMethod.BICUBIC);
}
else {
doc.resizeImage(UnitValue(fWidth,"px"),null,null,ResampleMethod.BICUBIC);
}
// Makes the default background white
var white = new SolidColor();
white.rgb.hexValue = "FFFFFF";
app.backgroundColor = white;
// 2012, use it at your own risk;
#target photoshop
if (app.documents.length > 0) {
activeDocument = doc;
var cwidth = 2000;
var cheight = 2000;
var originalRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
doc.resizeCanvas(cwidth, cheight, AnchorPosition.MIDDLECENTER)
app.preferences.rulerUnits = originalRulerUnits;
};
// our web export options
var options = new ExportOptionsSaveForWeb();
options.quality = 70;
options.format = SaveDocumentType.JPEG;
options.optimized = true;
var newName = 'MIR'+doc.name+'-30_40'+'.jpg';
doc.exportDocument(File(doc.path+'/'+newName),ExportType.SAVEFORWEB,options);
app.activeDocument.activeHistoryState = savedState
// get a reference to the current (active) document and store it in a variable named "doc"