Skip to content

Instantly share code, notes, and snippets.

@BGMcoder
Created March 11, 2015 03:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save BGMcoder/8eb194ad9eb182ecd661 to your computer and use it in GitHub Desktop.
Switch between Instantbird and any other program with a hotkey
#singleinstance force
#noenv
;directives
coordmode, mouse, screen ;set mouse to get coords from screen
settitlematchmode 2
;-------------------------------------------------------------------
;variables for the Instantbird focuser
instantbird := " - Instantbird" ;the title of the typing window is something like "Name of Person - Instantbird" --I confirm that the " - " is always in the title, complete with the two spaces on either side of the hyphen.
curwin := ""
lastwin := ""
;-------------------------------------------------------------------
;hotkey control+space
^space::InstantbirdFocuser()
InstantbirdFocuser(){
global
WinGetActiveTitle, curwin
IfInString, curwin, %instantbird%
{
winactivate, %lastwin%
lastwin := curwin
}else{
lastwin := curwin
winactivate, %instantbird%
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment