The following script works to open Firefox's location/"awesome" bar from anywhere using control-l
, except when using Acrobat/Adobe reader. This is because control-l
in Acrobat goes full screen. It works, but it's ugly and uses nested #ifWinNotActive
.
#IfWinNotActive, ahk_class MozillaWindowClass
#IfWinNotActive, ahk_class ahk_class AcrobatSDIWindow
^l::
WinActivate, ahk_class MozillaWindowClass
Send, ^l
return
#IfWinNotActive
#IfWinNotActive
The below code replacement doesn't work. Autohotkey doesn't complain with errors, but ignores the !WinActive conditionals and furthermore appears to become caught in an infinite loop. Any ideas why? (I tried the return statement both before and after the closing bracket.)
^l::
if (!WinActive(ahk_class,MozillaWindowClass)) and (!WinActive(ahk_class,AcrobatSDIWindow)) {
WinActivate, ahk_class MozillaWindowClass
Send, ^l
}
return