Answered
How to specify only the width and resolution when opening an image with a script in Photoshop, so that the height automatically changes proportionally?
I have pre specified the width, height, and resolution of the image. Unfortunately, due to the inability to directly and accurately obtain dimensions in InDesign, sometimes the width and height obtained in PS are incorrect.
Now I want to ask: Can it be achieved if only the width and resolution are specified, and the height varies proportionally with the width in ps?

function openImage(imPath, myResolution, iw, iw) {
app.bringToFront();
app.preferences.rulerUnits = Units.MM;
try {
var myFile = new File(imPath);
var myDoc = app.open(myFile);
} catch (e) { }
myDoc.resizeImage(iw, ih, myResolution, ResampleMethod.BICUBICSMOOTHER);
sTID = function (s) { return app.stringIDToTypeID(s); };
