Problem :
Problems
I had AHK set up on my computer, a few files (programmen.ahk and grammatik.ahk for example) in the same folder /ahk-script
I might have installed some program, because the script does not work as it should, I have noticed that SetTitleMatchMode is definately
not working as it should. Sometimes when I hit the hotkey, it works, but most of the times it does not.
I don’t know what it is, maybe I’ve installed some program? How can I troubleshoot this?
(In my naïve mind I thought it was because I switched from Aero to Basic, so I’m not a superuser but would need help from someone who are. I think I might be able to follow your instructions, especially since AHK is so important to me.)
Use case & script examples
It’s a pity since that’s how I activate my most used programs: Chrome, notepad++, explorer, evernote, calendar.
Here is a few scripts that used to work but now does not
Notepad++
^!::
SetTitleMatchMode 2
IfWinExist Notepad++
WinActivate, Notepad++
else
run "c:Program Files (x86)Notepad++notepad++.exe"
return
Chrome
^.::
SetTitleMatchMode 2
IfWinExist Google Chrome
WinActivate, Google Chrome
else
run "C:Program Files (x86)GoogleChromeApplicationchrome.exe"
return
Solution :
How can I troubleshoot this?
- Try with a full title to test the hotkey code itself.
- List all Windows that AHK sees with
WinGet, OutputVar, List
. - Test
SetTitleMatchMode, Fast|Slow
- Check if
AutoHotkey.exe
is ‘Run as Administrator’ (and if that makes a difference) - Try with newest AHK 1.1 (aka AHK_L) and/or AHK 1.0 version
Problem here is in hotkey combination (CTRL+ALT) that you are using. If you willchange hotkey combination (for example to CTRL+ALT+z), your script should work fine. I dont know exact reason why it does not works with (CTRL+ALT) but I think that other application is using that hotkey combination and there is some kind of conflict. Here is example script for notepad that uses CTRL+ALT+z hotkey combination and is working as intended.
^!z::
SetTitleMatchMode 2
IfWinExist Notepad
WinActivate, Notepad
else
run "notepad.exe"
return