It's simple with Image Resizer for Windows.
select all the pictures you want to resize
right-click the selected files to bring up the quick menu
click "Resize Pictures"
set your desired dimensions (width x height)
[since you mentioned you ...
If I get you correctly, you want this:
Switch to selection tool
Create an object that has the height you need
Copy the object to the clipboard
Activate the lock icon in the selection tool's tool controls
Select all the objects that you want to have that height
Select Edit > Paste Size > Paste height separately
Do you still need to script this, or is this ...
This is a case where you want to use a script to read the size & position of each layer's bounds so that it can dynamically transform them.
To use this script, copy the code into a plain text document, save, then rename the extension .txt -> .jsx
You can then drag the jsx into Photoshop to run it.
What you're asking for may noticeably stretch ...
It is possible to do this in illustrator without cranking up the calculator (it is also slightly more accurate as typed numbers only come with 5 digits of precission). 2 ways in fact.
Method one. Draw a line that represents your measurement. Copy the line and scale the original it to the size you wish the line to be. Make sure the measurement line is below ...
Using a calculator to find the right scaling is a good idea, drawing tricks do not help substantially. There's no such one click transformation which sets a wanted part of the drawing to wanted size.
But the calculator is not needed if you can reliably multiply with small integers in your head. The next trick applies it. Have smart guides and snap to point ...
Use -background none for transparent background
I determined that you can use -background none instead of -fill
mogrify -extent 640x640 -gravity Center -background none *.png
To design once for many different aspect ratios, scale up the smaller sizes to either the same width (#1), height (#2) or near-enough width and height (#3).
Which method you choose really depends on your design.
Each of these methods produce a range of similar sized rectangles, which you can spread out as canvases, over which you can lay out your design.