Page 1 of 1

Script issue with symbols

Posted: 17 Apr 2021, 03:05
by Jan1ce
This forum is a bit techy for me! Anyway, I have a problem with creating hotkeys - If there is a symbol, the script fails and stops at the first symbol. I have used a hotkey command for a couple of complicated strong passwords (ones I can't ask my software to remember) which must contain symbols but they fail every time they reach the symbol. Is this known? Is there a way around it? Simple answers please. I'm no geek!

Re: Script issue with symbols

Posted: 17 Apr 2021, 05:14
by swagfag
with no examples, theres nothing to go off of.
post ur script, restate what u think is wrong with it and what u expect it to do, then analysis can be performed

Re: Script issue with symbols

Posted: 17 Apr 2021, 13:11
by Jan1ce
Sorry, @swagfag - I didn't think there was any need and I wasn't keen to share a password! However... my script is

Code: Select all

^b::
Send, x7hK3#$Y0rKa2tMZw)6^EO^B
Return
When I hit Ctrl B, it types out x7hK3 and stops before # so it seems that the # is creating a block. I would say that Auto Hotkey doesn't like symbols, but I have scripts with @ in them that will execute in full. It may also help to know that my previous script had a plus sign at the end but no other symbols. The script also stopped before the + but it was easy enough to just add that one symbol myself. Does that help or confuse?

Re: Script issue with symbols

Posted: 17 Apr 2021, 13:16
by gregster
# acts like - a few other symbols - as a modifier while sending characters; see right at the top of the Send docs:
https://www.autohotkey.com/docs/commands/Send.htm#Parameters wrote:By default (that is, if neither SendRaw nor the Raw mode or Text mode is used), the characters ^+!#{} have a special meaning. The characters ^+!# represent the modifier keys Ctrl, Shift, Alt and Win. They affect only the very next key. To send the corresponding modifier key on its own, enclose the key name in braces.
In this case here, I would probably try

Code: Select all

Send, {text}x7hK3#$Y0rKa2tMZw)6^EO^B

PS: I moved your topic to normal 'Ask For Help' (v1), since your code doesn't seem to be v2 alpha code.