Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var savedRuler= app.preferences.rulerUnits;
- app.preferences.rulerUnits = Units.PIXELS;
- var w = app.activeDocument.width;
- var h = app.activeDocument.height;
- if(w<h) app.activeDocument.resizeCanvas (w, w, AnchorPosition.MIDDLECENTER);
- if(w>h) app.activeDocument.resizeCanvas (h, h, AnchorPosition.MIDDLECENTER);
- app.preferences.rulerUnits = savedRuler;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement