You can do this using Image Processor. Just set the one dimension that you want set and the other blank.
Hello 1.csuebele, thanks for the comment.
I was surprised that this was in Photoshop and not in the Bridge, but that is ok.
I was not allowed to leave the width blank, nor enter -1 or 0 for variable. I worked around it by using a width that was so large, it would never be used because the maximum height would be used. For example width: 9000, height: 400.
Unfortunately in Photoshop scripts, there seem to be no method to override the image proportion so that I could force a thumbnail of 400 wide and 300 high.
After all that though, here is the result, thank you. http://www.ots.at/jahresrueckblick/2013/
You can assess Image Processor in Bridge also. Click on Tools/Photoshop/Image Processor.