Created
January 25, 2021 12:45
-
-
Save msongz/cbed77168c28bf55a9c18c2a898202ce to your computer and use it in GitHub Desktop.
Function key to show/hide app by one hit
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
F3:: | |
UniqueID:="ahk_id " WinExist("Files") | |
if !WinExist(UniqueID){ | |
Run C:\Users\songz\Creative Cloud Files\Files.lnk | |
return | |
}else{ | |
if WinActive(UniqueID){ | |
WinMinimize,%UniqueID% | |
return | |
}else{ | |
WinActivate,%UniqueID% | |
return | |
} | |
} | |
F4:: | |
UniqueID:="ahk_exe sublime_text.exe" | |
if !WinExist(UniqueID){ | |
Run %A_ProgramFiles%\Sublime Text 3\sublime_text.exe | |
return | |
}else{ | |
if WinActive(UniqueID){ | |
WinMinimize,%UniqueID% | |
return | |
}else{ | |
WinActivate,%UniqueID% | |
return | |
} | |
} | |
F5:: | |
UniqueID:="ahk_exe WindowsTerminal.exe" | |
if !WinExist(UniqueID){ | |
Run C:\Users\songz\Creative Cloud Files\Windows Terminal.lnk | |
return | |
}else{ | |
if WinActive(UniqueID){ | |
WinMinimize,%UniqueID% | |
return | |
}else{ | |
WinActivate,%UniqueID% | |
return | |
} | |
} | |
F6:: | |
UniqueID:="ahk_class WeChatMainWndForStore" | |
;UniqueID:="ahk_exe WeChatStore.exe" | |
if !WinExist(UniqueID){ | |
Run C:\Users\songz\Creative Cloud Files\微信.lnk | |
return | |
}else{ | |
if WinActive(UniqueID){ | |
WinMinimize,%UniqueID% | |
return | |
}else{ | |
WinActivate,%UniqueID% | |
return | |
} | |
} | |
F7:: | |
UniqueID:="ahk_exe Telegram.exe" | |
if !WinExist(UniqueID){ | |
Run C:\Users\songz\Creative Cloud Files\Telegram Desktop.lnk | |
return | |
}else{ | |
if WinActive(UniqueID){ | |
WinMinimize,%UniqueID% | |
return | |
}else{ | |
WinActivate,%UniqueID% | |
return | |
} | |
} | |
F8:: | |
UniqueID:="ahk_class AE_CApplication_17.6" | |
if !WinExist(UniqueID){ | |
Run %A_ProgramFiles%\Adobe\Adobe After Effects 2020\Support Files\AfterFX.exe | |
return | |
}else{ | |
if WinActive("ahk_exe AfterFX.exe"){ | |
WinMinimize,%UniqueID% | |
return | |
}else{ | |
WinActivate,%UniqueID% | |
return | |
} | |
} | |
;use winspy to get exe/class name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment