Send Text Slowly Only to Specific Windows

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
shipaddicted
Posts: 106
Joined: 15 Jul 2016, 19:57

Send Text Slowly Only to Specific Windows

24 Mar 2022, 16:20

I have a few windows that jumble up the hotstrings or text from a script when Sending. I normally use SendMode, Input (with no SetKeyDelay), and I like that setting for 90% of the apps I use. However, some places, like Excel and CodeQuickTester, for example, it's a mess and I usually have to go back and fix a ton of stuff.

I use the function below to slow down the text on those sites since I don't use SetKeyDelay when I am pasting from a script, which works well. But I still have a problem with Hotstrings. I was wondering if there was a way to tell the Hotstrings to paste slowly only in some windows without having to edit every entry or have a huge duplicate list of Hotstrings for every site that I need the text to go slowly. I definitely don't want to slow all text input on all sites, just those that are quirky.

The only thing I saw in the documentation was the Kn option, but this would change the Hotstring everywhere, not just the problem sites.

Code: Select all

SendSlow(textToSend, pauseTime=10)
{
	Loop, parse, textToSend
	{
		If textSendInProgress
		Sleep, %pauseTime%
		Send, %A_LoopField%
		textSendInProgress:=true
	}
}
Got any ideas? :idea:
User avatar
mikeyww
Posts: 27165
Joined: 09 Sep 2014, 18:38

Re: Send Text Slowly Only to Specific Windows

24 Mar 2022, 18:45

Code: Select all

GroupAdd, slow, ahk_exe notepad.exe
GroupAdd, slow, ahk_exe chrome.exe
:X:this::sendx("that")

sendx(str) {
 SetKeyDelay, WinActive("ahk_group slow") ? 100 : 0
 Send {Text}%str%
}
shipaddicted
Posts: 106
Joined: 15 Jul 2016, 19:57

Re: Send Text Slowly Only to Specific Windows

24 Mar 2022, 20:37

But if I make a window group for the slow apps, won't I have to duplicate my entire hotstring list into this group?
User avatar
mikeyww
Posts: 27165
Joined: 09 Sep 2014, 18:38

Re: Send Text Slowly Only to Specific Windows

24 Mar 2022, 20:54

No. The example is in my post. It does not duplicate anything.
shipaddicted
Posts: 106
Joined: 15 Jul 2016, 19:57

Re: Send Text Slowly Only to Specific Windows

24 Mar 2022, 21:36

ooohhhhh ... I think I get it ... ok I will put it through its paces & report back.

Thanks!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 89 guests