Hotstring not backspacing completely & dropping end of line:
I've been having this issue for quite some time and I'm finally irritated enough to post for help. I've searched the forums but can't find an answer. I'm using a close variation of the "Hotstring Helper" found in the AHK documentation.
Issue: When using hotstrings, sometimes AHK will not process a hotstring correctly as in the following:
____Hotstring:
:*rc1:sd``::
SendInput, shutdown -r -m \\10.1.1.1 -t 60
return
____Result:
sshutdown -r -m \\10.1.1.1 -t 6
Most hotstrings process correctly but SOME ALWAYS result in the first typed letter (sometimes the first 2 or 3) NOT being backspaced and then subsequently, the first, second or third of THE END of the string not appearing (depending on how many TYPED letters weren't backspaced):
Example:
____Hotstring:
:*rc1:lmgts``::Let me get this straight
____Result:
lmgLet me get this strai
System & more issue info:
WinXPProSP3
Happening across all different CPU's (Intel/AMD) and abilities (single/dual/quad-core) with lots or little memory.
AHK vers 104805 (...but it's been happening for the last 3 or so versions - maybe more.)
Happens whether it's a direct hotstring or a "SendInput"
** update to the preceding line: I replaced SendInput with Send as a test and voila!, This caused the hotstring to process correctly (albeit slower)! I'm starting to wonder if AHK isn't processing the hotstring fast enough (or too fast) for the PC to handle (in other words, at SendInput speeds, AHK or PC can't keep up).
Geez, while testing the issue in order to create this post, I tried the Send command... I had to adjust the AutoExecute section (I had "SendMode InputThenPlay" in AutoExecute section which was forcing my Send tests to be SendInput) and NOW I get the below result (it's now backspacing correctly). Also, the SendInput (further down) shouldn't be affected by the "SetKeyDelay, 50" but it's now working correctly -- all I changed was to remove the SendMode and added a SetKeyDelay (both of which shouldn't affect SendInput at all) so there's another confusing situation for me (and for you to answer, if you can).
When I try the following I get the next result:
____Hotstring:
:*rc1:sd``::
Send, shutdown -r -m \\10.1.1.1 -t 60 -c `"Please save anything and Restart PC{!}`"
return
____Result:
shutdown -r -m \\10.1.1.1 -t 60 -c "Please save anything and Restart PC!"
____Hotstring:
:*rc1:sd``::
SendInput, shutdown -r -m \\10.1.1.1 -t 60 -c `"Please save anything and Restart PC{!}`"
return
____Result:
shutdown -r -m \\10.1.1.1 -t 60 -c "Please save anything and Restart PC!"
(P.S. I thought that the R (RAW) in the hotstring commands would write out the {!} but it didn't -- I guess the Send overrides the hotstring's commands and if I WANTED the {}, I'd have to put SendRaw -- good-to-know.)
Anyways, there's the SendInput now working correctly and I dunno why when it failed earlier (again, all I did was to remove the SendMode and added a SetKeyDelay for the Send test).
So, my testing leads me to believe that sometimes AHK runs faster than the PC can handle (or maybe it's the other way around). Of course, that doesn't make sense and why is it only on certain hotstrings? Another answer is that I'm not fully informed on correct hotstring creation. [grin] This is probably a Known Issue (or I'm doing it wrong) but I sure can't figure it out (or search it out). Please reply if you have any answers/thoughts!
P.S.S. Oh yeah, I almost forgot... On some of my problematic hotstrings (like one containing a bunch of e-mail addresses), if I run it in a Notepad it works perfectly but fails (as discussed above) if I run it directly in a Outlook Express message "TO:" line. It seems that certain windows/programs don't deal with hotstrings as well as others (Internet Explorer will also sometimes munge hotstrings as discussed above).
Thanks very much in advance.