My theory is that the “Move and Resize Front Window” action indeed moves the window first and resizes it second and thereby the Front Window got in a limbo state where got somehow stuck between both displays and therefore can’t be resized.
Is there another way instead of splitting “Move and Resize Front Window” action in three parts/steps?
Yes, it does seem to be a "two part" operation, and the OS (not the KM action) can throw a wobbly when the "intermediate" window's bounds don't fit the display area. Easiest way round that in this case is a two-step move and resize, setting the width to that of your vertical display before moving and completing the resize:
Depending on your tolerance for flashing windows, you may prefer to keep the window at the same position and height and just change the width in the initial action (which will work because if it fits on display 2 at the start it will still fit when the width is changed to suit display 1, as display 1 is the narrower).
Okay, I really should not be sharing this because it's unfinished and I've literally ripped it out of a larger window management framework that I'm trying to complete. And I don't even have the time right now to test that I've not broken it by doing that.
So no promises. But it can't do anything bad, and it is a very useful subroutine. (I promise I'll release something more polished and featurific once I catch up with stuff)
It's mostly self documented. Essentially, call the subroutine providing some or all of the arguments. Only the destination display is mandatory. Called like that, it will move the current front window to that display and proportionally scale the window. (I have the same portrait and landscape setup) Or you can provide left, top, width and height as absolute values. Or as percentages. (I like % because I change my resolutions around)
@Nige_S I implemented your suggestion because a) yours was the first and b) it was quickly to implement. Thank you for your quick feedback.
@devoy Also thank you for sharing this extensive library of macros. I will dive deeper into them once I find the time. So far these macros look very advanced and it will take some crunching to digest and adapt them.