I would like to add partial window title matching to #IfWinActive. For example to match any notepad window, regardless wether the title is "Untitled - Notepad" or "MyFile - Notepad"
This should be very simple. My attemtps:
SetTitleMatchMode, Regex
SetTitleMatchMode, Slow
#IfWinActive *.Notepad
+n::b
#IfWinActive
second attempt matchmode 2 should match anywhere
SetTitleMatchMode, 2
#IfWinActive Notepad
+n::b
#IfWinActive
A test with using the full title Untitled - Notepad confirms that the code +n::b does substute Shift-n for Shift-b
NOTE: ahk_class is not an option as the class is different on every machine for the target programme TeXnicCenter
As Robert Ilbrink said, my second example actually works, and the problem was that I did not place SetTitleMatchMode at the very top of my script.
The default example script for ^!n
was in effect and interfered. Not exactly sure why it does that, but placing SetTitleMatchMode at the top solved my problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With