Send vs SendText vs SendInput for text input?

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
slishnevsky
Posts: 29
Joined: 07 Mar 2024, 06:50

Send vs SendText vs SendInput for text input?

29 Apr 2024, 13:40

Hi.

I couldn't understand from the documentation which is the best method to send text into text field in terms of speed?
When I do this in Twitter reply, any of these methods work quite slow and part-by-part for just one sentence.
It takes about 2-3 seconds to send text into the input field.

Why is it so slow?
It should be almost instant.
User avatar
mikeyww
Posts: 27146
Joined: 09 Sep 2014, 18:38

Re: Send vs SendText vs SendInput for text input?

29 Apr 2024, 14:57

Hello,

You can use your script to determine which approach is the fastest, because a script can compute elapsed time.

SendInput is the default Send mode.

If you are sending only text or using syntax otherwise recognized by text mode, then text mode may be a good choice.

What your target program, other programs, or CPU might also be doing at the same time might be beyond your control.

If you have a script that does not work, posting it in the forum enables others to examine it, test it, and provide you with specific feedback about it.
If a script other than the one executing SendInput has a low-level keyboard hook installed, SendInput automatically reverts to SendEvent (or SendPlay if SendMode "InputThenPlay" is in effect). This is done because the presence of an external hook disables all of SendInput's advantages, making it inferior to both SendPlay and SendEvent. However, since SendInput is unable to detect a low-level hook in programs other than AutoHotkey v1.0.43+, it will not revert in these cases, making it less reliable than SendPlay/Event.
Source: Send - Syntax & Usage | AutoHotkey v2
SetKeyDelay allows you to alter key delays if you are not using SendInput.

An alternative to Send would be using the Windows clipboard.
User avatar
xMaxrayx
Posts: 199
Joined: 06 Dec 2022, 02:56
Contact:

Re: Send vs SendText vs SendInput for text input?

30 Apr 2024, 10:11

@slishnevsky
if you have a huge text wall you better use A_clipboard method because its faster and has no erorr, sendinput is good for mimicking the keyboard, especially triggering the program's functions by keyboard shortcuts.
-----------------------ヾ(•ω•`)o------------------------------
https://github.com/xmaxrayx/

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: robinson and 34 guests