Last active
January 30, 2024 10:29
-
-
Save rubenhorn/698203535bb66fb241e5c0ab3d55d2eb to your computer and use it in GitHub Desktop.
AutoHotkey script for moving active window to main monitor
This file contains 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
#SingleInstance force | |
; Hotkey: Alt + S | |
!s:: | |
; Check if window active window exists | |
WinGetTitle, t, a | |
if(t = "Program Manager" or t = "") { | |
MsgBox ,, No window selected!, Please select a window.`n(Alt + Tab) | |
return | |
} | |
; Get bounding coordinates of the main monitor | |
SysGet n, MonitorPrimary | |
SysGet b, monitor, n | |
; Move window to main monitor | |
WinMove a,, bLeft, bTop | |
; End of script | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment