;%1% = parameter number 1 passed from VC ;Gosub calls the function down below Gosub, %1% %1% := return ;This will Focus XBMC XBMC: setTitleMatchMode, 2 IfWinExist XBMC WinActivate XBMC return ;This will focus Chrome, I'm using ahk_class so it wont matter which tab has focus Chrome: setTitleMatchMode, 2 IfWinExist ahk_class Chrome_WidgetWin_1 WinActivate ahk_class Chrome_WidgetWin_1 return