Send (and alternatives) results in 'Send' itself being included Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
RickC
Posts: 299
Joined: 27 Oct 2013, 08:32

Send (and alternatives) results in 'Send' itself being included

Post by RickC » 16 Aug 2022, 06:39

I used to use the following to create a horizontal line in a forum post:

Code: Select all

:*:---::[hr][/hr]  ; Send HTML tags for horizontal line by presssing 3 hyphens

However, whilst effective, the horizontal line was very faint. I found that using consecutive underline characters created a thicker horizontal line.

The docs for Send say: To repeat a keystroke: Enclose in braces the name of the key followed by the number of times to repeat it.

As a result I changed my code to:

Code: Select all

:*:---::Send {_ 63} ; Send 63 consecutive underscore characters to form horizontal line by presssing 3 hyphens

The line itself looks much, much better... but I don't understand why 'Send' is prefixed to the output.

Image

The same behaviour happens if I use alternatives to Send like SendInput or SendRaw.

Can anyone explain and/or offer a fix or workaround? TIA

I'm using AutoHotkey 1.1.33.11 in Windows 10 Pro 1809.

Edit: I've just upgraded to latest version of AutoHotkey 1.1.34.03... it made no difference.

wetware05
Posts: 750
Joined: 04 Dec 2020, 16:09

Re: Send (and alternatives) results in 'Send' itself being included

Post by wetware05 » 16 Aug 2022, 06:57

Hi.
The line that you show in the first code does nothing by itself, other lines have to precede it, which is the one that takes the script to action. The line you show next isn't using the "send" code, it's just text.

Show more parts of your script. The ones above.

BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Send (and alternatives) results in 'Send' itself being included  Topic is solved

Post by BoBo » 16 Aug 2022, 07:05

You're using a Hotstring (AKA a string replacement) instead of a Hotkey (task processing).
Check out a Hotstrings 'x' (AKA execution) parameter.
… and sending 63 chars might end up quite slow. Pasting a concatenated string of that character in one go instead should do the trick.

RickC
Posts: 299
Joined: 27 Oct 2013, 08:32

Re: Send (and alternatives) results in 'Send' itself being included

Post by RickC » 16 Aug 2022, 08:31

Thanks, @BoBo, for the explanation.

Silly of me - you're right of course. I just wasn't thinking. I changed the line to the following and it now works perfectly.

Code: Select all

:*:---::_______________________________________________________________ ; Send 63 consecutive underscore characters to form horizontal line by presssing 3 hyphens

Post Reply

Return to “Ask for Help (v1)”