Send Variable as an input

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
SSQUAD
Posts: 2
Joined: 17 Sep 2020, 21:24

Send Variable as an input

17 Sep 2020, 21:30

i want to send an input {Tab} in this case a lot of times and multiple times but when I set a variable as {Tab} it just sends "{Tab}" instead of the input of the tab key.

Code: Select all

tab49 = {Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}
tab10 = {Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}
F11::
SendRaw %tab10%
SSQUAD
Posts: 2
Joined: 17 Sep 2020, 21:24

Re: Send Variable as an input

17 Sep 2020, 21:39

Nevermind I figured it out lol
User avatar
Jim Dunn
Posts: 478
Joined: 01 Sep 2020, 20:21
Location: NSW

Re: Send Variable as an input

17 Sep 2020, 22:08

Glad you figured it out. :)

The 'simplest' way, without the need to create any variables, is:

Code: Select all

F11::Send, {Tab 10}
and/or (depending what hotkey(s) you want to define)

Code: Select all

F12::Send, {Tab 49}
So I guess that's how you did it. ;)
If, instead, you really wanted to do it with a variable, this should work:

Code: Select all

varTab10 := "{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}{Tab}"
F11::Send, % varTab10
... or even:

Code: Select all

varTab10 := "{Tab 10}"
F11::Send, % varTab10
:)
User avatar
ositoMalvado
Posts: 183
Joined: 24 Dec 2019, 12:02
Contact:

Re: Send Variable as an input

18 Sep 2020, 01:17

Another solution

Code: Select all

keyToSend:="Tab"
timesToSend:=49
return
f11::
	SendInput, % "{" keyToSend " " timesToSend "}"
return
My WEB some useful stuff
User avatar
Jim Dunn
Posts: 478
Joined: 01 Sep 2020, 20:21
Location: NSW

Re: Send Variable as an input

18 Sep 2020, 01:29

ositoMalvado wrote:
18 Sep 2020, 01:17
Another solution

Code: Select all

keyToSend:="Tab"
timesToSend:=49
return
f11::
	SendInput, % "{" keyToSend " " timesToSend "}"
return
:thumbup:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mankvl, OrangeCat, sanmaodo, zerox and 321 guests