I found a bug in my script where 2 windows of similar names were being called by WinActivate based on which window I clicked on last before running the script. I isolated the line of code that was having the issue and tried using SetTitleMatchMode to solve it, however when using setting 3 (exact match), it's not identifying either of the windows (I thought it would identify 1 window). When I use setting 1 or 2, it identifies both windows (as expected)
I'm looking for a window called 5YR-TNOTE MAR23. I have used windows spy to confirm this is the Window Title. I also have a window called 5YR-TNOTE vs 10YR-TNOTE F IPS MAR23. According to Window Spy, they both have the same exact ahk_class, ahk_exe and ahk_pid, so SetTitleMatchMode seems like the best solution in this case.
Any idea why the exact match isn't picking up anything? Could the variable be affecting it?
Code: Select all
global globalTsysMonth := MAR23
+r::
SetTitleMatchMode, 3
WinActivate, 5YR-TNOTE %globalTsysMonth%
return