Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Maximize and Move Windows v2
- Created by: SlyFox1186
- Pastebin: https://pastebin.com/u/slyfox1186
- Required: AutoHotkey.exe
- This script will move all windows that match the process names defined inside the expression.
- All windows will be centered according to the screen's dimensions.
- Add window names inside the '_procNames' variable below.
- Add each name on its own line.
- Do not include '.exe' at the end of each name.
- */
- #Persistent
- #SingleInstance, Force
- !c::
- _procNames := "
- (
- cmd
- debian
- Discord
- mintty
- Steam
- Spotify
- )"
- _procNames := RegExReplace(_procNames, "([a-zA-Z\d]+)", Replacement := "$1.exe")
- Loop Parse, % _procNames, `n
- {
- WinGet, win, PID, ahk_exe %A_LoopField%
- WinGet, _IsMax, MinMax, ahk_pid %win%
- If (_IsMax = 1)
- WinActivate, ahk_pid %win%
- WinGetPos,,, _Width, _Height, ahk_pid %win%
- WinMove, ahk_pid %win%,, (A_ScreenWidth/2)-(_Width/2), (A_ScreenHeight/2)-(_Height/2)
- }
- Return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement