Created
February 1, 2020 03:14
-
-
Save josefandersson/1e6259332e08adad727ba587fdf310de to your computer and use it in GitHub Desktop.
Move open windows from one monitor to the other on dual monitor setups
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WinGet, windows, List | |
Loop %windows% | |
{ | |
id := windows%A_Index% | |
WinGetPos, x, y,,, ahk_id %id% | |
WinGetTitle, wt, ahk_id %id% | |
StringLen, tl, wt | |
If tl > 0 And WinExist("ahk_id" . id) | |
{ | |
If x < -8 | |
{ | |
WinMove, ahk_id %id%,, x+1920, y | |
} | |
Else | |
{ | |
WinMove, ahk_id %id%,, x-1920, y | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment