Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JoeGlines/c8f42de134b5ffb3211bba3fcf972ff9 to your computer and use it in GitHub Desktop.
Save JoeGlines/c8f42de134b5ffb3211bba3fcf972ff9 to your computer and use it in GitHub Desktop.
;*******************************************************
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey Udemy courses. They're structured in a way to make learning AHK EASY
; Right now you can get a coupon code here: https://the-Automator.com/Learn
;*******************************************************
#SingleInstance,Force
;**************************************
!p::ToggleVisibility("Pushbullet Pro") ;Alt+P will run
;~ WindowTitle:="Pushbullet Pro"
;~ ToggleVisibility(WindowTitle) ;Call the function
return
;********************Defining the Function***********************************
ToggleVisibility(WindowTitle){
WinGet WinStatus, MinMax,% WindowTitle
IfEqual WinStatus,-1,WinRestore ,% WindowTitle ;If the widnow is minimized->Restore
IfEqual WinStatus, 1,WinRestore ,% WindowTitle ;if the window is maximized->Restore
IfEqual WinStatus, 0,WinMinimize,% WindowTitle ;The window is neither minimized nor maximized=>Minimize it
}
;~ return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment