Shortcut keys to automatically square a canvas

BL
Posted By
Bruce_Laffee
Oct 19, 2006
Views
1954
Replies
3
Status
Closed
I’m hoping that there is a shortcut key that will automatically square the canvas for an image without having to go into the image and canvas menu.
I’m trying to add this to an action so I get a square for each image. Now when I record the action and go to the image and canvas menu and copy the largest dimension and paste it into the smallest dimension the action remembers the value that I copied and automatically past that into each image it processes.
Since the images are various sizes, both Horizontally and vertically they don’t end up square when the action runs because it is only pasting one value into each images.
If there was a shortcut key to square the canvas the problem would be eliminated. I have to run this action on several hundered images and the only way I can see doing this without the shortcut key to square the canvas is to do it manually.

Any help is appreciated.

Thanks,
Bruce

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

Y
YrbkMgr
Oct 20, 2006
You could create a New Image Template, like the ones that are listed in the dropdown of the New dialog…

That way, you just pick it from the dropdown list whenever you create a new image.

Unless you’re talking about doing it for existing images, then you might look into File|Automate|Fit Image.
DR
Danny Raphael
Oct 20, 2006
I need some help understanding what you’re trying to do… Is this it: If you had a 4"x6" image and a 7"x5" image, does squaring them result in a 6"x6" and 7"x7", in essence take the longer side and adjust the shorter side so it’s the same length?

If not, help me see the light and perhaps I can help.
GD
george_dingwall
Oct 20, 2006
Hi Bruce,

If you are using CS or CS2, this script will sqaure the canvas regardless of the size or orientation of the image. You can run it from an action and so allocate a shortcut key.

– – – – Script starts here – – – –

var orig_ruler_units = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
var doc = activeDocument
var width = doc.width.value
var height = doc.height.value;
if (width > height) {
longSide = width;
} else {
longSide = height;
}
doc.resizeCanvas(longSide,longSide);
app.preferences.rulerUnits = orig_ruler_units;

– – – – Script ends here – – – –

Hope this helps,

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

Related Discussion Topics

Nice and short text about related topics in discussion sections