0

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)\Google\Chrome\Application\chrome.exe"
return
  • First of all, You don't need to set SetTitleMatchMode in every routine, setting it once at the top of your script is enough. Once you have done a IfWinExist, there is no need to use the title in WinActivate. Just use WinActivate without any arguments. Please share which OS you are using. – Robert Ilbrink Jul 8 '14 at 11:56
  • Ok, so the script can be improved ("it does not need x and y"). But the problem was: the script worked before, now it does not. How can I troubleshoot to find out whats wrong? Or maybe get a script that does work. – user1603548 Jul 8 '14 at 15:53
0

How can I troubleshoot this?

0

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
  • ^. don't work as well so that cannot be the soolution. – user1603548 Jul 15 '14 at 20:06
  • @user1603548 I test it again and it works here. Download last version of AutoHotkey from here ahkscript.org . Try to remove hotkey (remove lines ^!z:: and return). After launch the file. If it works try different combinations of hotkeys. If it does not works, then login in to the windows as administrator, turn off antivirus and other software that can interact with your script and try again. – vasili111 Jul 16 '14 at 3:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.