画像サイズの縦横比を統一するJSX。
幅と高さのうち大きいほうにサイズ変更します。
function ResizeToSquare(){
preferences.rulerUnits = Units.PIXELS;
var width = activeDocument.width;
var height = activeDocument.height;
if( width > height ){
activeDocument.resizeCanvas(width,width,AnchorPosition.MIDDLECENTER);
}else{
activeDocument.resizeCanvas(height,height,AnchorPosition.MIDDLECENTER);
}
}