#target photoshop
var strtRulerUnits = app.preferences.rulerUnits;
var strtTypeUnits = app.preferences.typeUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var White = new SolidColor;
White.rgb.hexValue = 'ffffff';
backgroundColor = White;
if(activeDocument.width.value > activeDocument.height.value){
app.activeDocument.resizeCanvas(activeDocument.width.value, activeDocument.width.value, AnchorPosition.MIDDLECENTER);
}else{
app.activeDocument.resizeCanvas(activeDocument.height.value, activeDocument.height.value, AnchorPosition.MIDDLECENTER);
}
app.activeDocument.resizeImage(new UnitValue(150,'mm'), undefined, undefined, ResampleMethod.BICUBIC);
app.preferences.rulerUnits = strtRulerUnits;
app.preferences.typeUnits = strtTypeUnits;