Move Window Between Displays

I'm trying to mimic some functionality from some of the window moving utilities where if a window is on screen 1 and the hotkey is pressed it moves the window to screen 2 and vice versa.

This one for example is meant to move to the "left half" of the main display. If it's already there, move it to the left half of the second display:

image

This works to move it to the second display, but then it's showing true when the front window is on the second display in the left half, even though I'm comparing to "SCREENVISBLE(Main,...)"

The contains text is just the text to mimic the Main screen's left frame:

%Calculate%SCREENVISIBLE(Main,Left)%,%Calculate%SCREENVISIBLE(Main,Top)%,%Calculate%SCREENVISIBLE(Main,Width)*0.5%,%Calculate%SCREENVISIBLE(Main,Height)%

That's probably the problem -- you're testing for "contains".

Your "contains" calculation will evaluate to something like

0,25,1280,1415

But the correctly-positioned, second display, frame will be something like:

-2560,25,1280,1415

...which does indeed "contain" the first, albeit it with -256 before it!

Try "is" instead.

1 Like

Oh my... Yep. :man_facepalming:t2: Thank you @Nige_S!