I have been trying various ways of resizing a document that will work as a macro. My aim is to resize a document so that the longest side is some fixed length. I have devised a formula/equation that works in the Transform panel. However it will not operate as a macro. The formula will not work in Document > Resize either. I understand equation will work in Filter > Distort > Equations but I have not yet worked out how to get t to do what I want.
My first attempt to resize to a maximum side length of 800px with the shorter side of 600px is:
X = x*x/800/a
Y = y*y/600/a
I then used Document > Clip Canvas to remove the transparent area. This looked OK, but the size was about twice as large as it should be, 1737 ×1296 for a landscape and 1342×1789 for a portrait. I included the a parameter to allow me to resize, but there is no way I can read or impose a numerical value for a.
The logic of my formula is that x/800 and y/600 are the scaling factors between the target and actual sizes. The equations seem to require that I put these in reciprocally!
I can usually wrestle with these algebraic conundrums, but this seems to have me beat.