1
votes

I try to get Google Chrome focused by a Hotkey:

;Focus Chrome
^!l::
WinActivate,ahk_class Chrome_WidgetWin_1

Everytime i fire this Google Chrome get focused directly but then my IDE is getting focus immediately. No matter what window is focused while i press "Ctrl+Alt+L"

2
Sorry, misunderstood your question. I think you either have a global shortcut in your IDE, or you have another AutoHotkey key that activates your IDE. - fxam
Found out that i might need some "break" statement. If i switch the IDE-Focus shortcut it will do the opposite for the IDE. - Jonathan
is that really the whole script? - Joe DF
After what time focus gets back to IDE? If you manually(with your mouse, no script) make focus on Chrome, the focus gets back to IDE? - vasili111
What a joke, if the accepted solution was truly the answer. Next time post your full script. - mikew

2 Answers

2
votes

I just added return, but it works for me:

^!l::
WinActivate,ahk_class Chrome_WidgetWin_1
return
0
votes

Sometimes its easier to focus by executable name:

WinActivate,ahk_exe chrome.exe