Strange AHK behavior?

Get help with using AutoHotkey and its commands and hotkeys
opey
Posts: 7
Joined: 20 May 2019, 13:04

Strange AHK behavior?

20 May 2019, 13:13

I have this in my AHK script:

#!q::
send, [email protected]@[email protected]!9
return

which produces this result:

[email protected]@[email protected]

So the "!9" at the end of the send is getting cut off.

When I change the send to this:

send, [email protected]@[email protected]!9

I get this result:

[email protected]@[email protected]

So it seems that everything after the 3rd "@" gets ignored/truncated.

I've tried workarounds but nothing seems to work.

Anyone have an idea what's causing this?
User avatar
Xtra
Posts: 1459
Joined: 02 Oct 2015, 12:15

Re: Strange AHK behavior?

20 May 2019, 13:20

Try:

Code: Select all

#!q::
sendraw, [email protected]@[email protected]!9
return
or wrap the ! in { }

Code: Select all

#!q::
send, [email protected]@[email protected]{!}9
return
HTH
opey
Posts: 7
Joined: 20 May 2019, 13:04

Re: Strange AHK behavior?

20 May 2019, 13:28

Thanks, HTH. Both of them worked.

Why?
MannyKSoSo
Posts: 434
Joined: 28 Apr 2018, 21:59

Re: Strange AHK behavior?

20 May 2019, 13:40

The first one works since its sending each character as its raw form (! represents the Alt command in ahk send). The second one works since normally ! is the alt command and the {} force the character to be seen as a string rather than a command to follow. The same thing would happen if you used ^ as it represent the control key. https://autohotkey.com/docs/commands/Send.htm is where you can see all the special characters.
User avatar
Xtra
Posts: 1459
Joined: 02 Oct 2015, 12:15

Re: Strange AHK behavior?

20 May 2019, 14:11

Just to add to the post above.
Click sendraw in the codebox to bring up sendraw in the helpfile.
opey
Posts: 7
Joined: 20 May 2019, 13:04

Re: Strange AHK behavior?

21 May 2019, 20:02

ok thanks for the extra info on that!

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Cerberus, gignu, Google [Bot], malcev, Thetaburn and 69 guests