I need help to see why my label containing an if statement doesn't get triggered. Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Kellyzkorner_NJ
Posts: 84
Joined: 20 Oct 2017, 18:33

I need help to see why my label containing an if statement doesn't get triggered.  Topic is solved

02 Feb 2019, 21:32

For the label below I can't seem to get it to recognize my space, right or s if statement for the space or s options. The others SEEM to work usually. I had a terminating / that was escaped, though maybe you don't need to escape those, I'm not sure, but I took it out trying to troubleshoot. The first one, u|n works flawlessly. Oddly the space one if I use {space} or s it pastes the doctor name with a period. I have no idea where that was coming from so I added the just space option at end but I don't want to have to wait for it to time out to that every time. I'm using 1.1.24.1.0 if that helps.
Thanks in advance for any help.

Code: Select all

:*:somedoc:: ; <-- Send Some Doctor, MD
Gosub enteruppaste
Send Some Doctor, MD
Return

enteruppaste:
;Input, character, L1 T1, {ENTER}{SHIFT}/, u,n,{SPACE},{RIGHT},p,c,s
Input, character, T1, , u,n,p,c,s,{SPACE},{RIGHT},.,,

If ((character ~= "u|n")) ; Delete next word
{
Send {UP}{END}{ENTER}{HOME}.{LEFT}
Return
}
Else 
If ((character ~= "p|."))
{
;Msgbox, 4100, , period, 0.6
Send `.{LEFT}
Return
}
Else
If ((character ~= "c|,"))
{
;Msgbox, 4100, , comma, 0.6
Send `,{SPACE}{LEFT 2}
Return
}
Else
If ((character ~= "s|{SPACE}|{RIGHT}"))
;If character contains s,{space},{RIGHT}
{
Msgbox, 4100, , space, 0.3
Send {SPACE}
Return
}
Else
Send {SPACE}
Return

User avatar
AlphaBravo
Posts: 586
Joined: 29 Sep 2013, 22:59

Re: I need help to see why my label containing an if statement doesn't get triggered.

02 Feb 2019, 23:28

this If ((character ~= "p|.")) means "p" or anything, change to If ((character ~= "p|\."))
User avatar
Kellyzkorner_NJ
Posts: 84
Joined: 20 Oct 2017, 18:33

Re: I need help to see why my label containing an if statement doesn't get triggered.

03 Feb 2019, 00:01

AlphaBravo, that helped a ton. I wasn't thinking along the line of RegEx. Do you have any idea why the space and right keys in the space section don't trigger it but only the letter s option?
just me
Posts: 9495
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: I need help to see why my label containing an if statement doesn't get triggered.

03 Feb 2019, 03:14

Input wrote:OutputVar does not store keystrokes per se. Instead, it stores characters produced by keystrokes according to the active window's keyboard layout/language. Consequently, keystrokes that do not produce characters (such as PageUp and Home) are not stored (though they can be recognized via the EndKeys parameter below).

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Darkmaster006, Google [Bot], ShatterCoder and 162 guests