JnLlnd wrote: ↑31 Dec 2018, 14:59
FanaticGuru wrote: ↑31 Dec 2018, 13:48
For string function and label references to work you just need to do an
On command for the hotstring. You don't have to turn it
Off in order for this to work.
With the workaround all the Hotstrings work as expected in the example above.
In my example, it is a label (Go:) and it would not work until, after the hotstring is created, it is turned OFF and turned ON again.
No need to turn it Off, just create and then turn On in two separate commands:
Code: Select all
strHotstring := ":X*:#go#"
Hotstring(strHotstring, "Go") ; first to create
Hotstring(strHotstring, "Go", "On") ; then again with On to fix bug
return
Go:
MsgBox, The hotstring "%A_ThisHotkey%" was eXecuted!
return
You could do it this way:
Code: Select all
Hotstring(strHotstring, "Go", "On") ; first to create
Hotstring(strHotstring, "Go", "On") ; then again to fix bug
The point being that you have to use "On" with a pre-existing Hotstring. Turning it Off is irrelevant. It is the "On" with an existing hotstring that makes it work. You can turn a Hotstring On that is already On.
Not to get side tracked though, this is definitely buggy. And this is only a in an emergency do-it-twice workaround but if you really need it then it should work and not break the script once the bug is fixed.
FG