Page 1 of 1

Inconsistency running my script

Posted: 18 Jan 2022, 16:51
by hotsku11er

Code: Select all

!q::  ; radwan
SendInput, John{Tab}
SendInput, Peterson{Tab}
SendInput, 133718{Tab}
SendInput, Johnpeterson@gmail.com{Tab}
SendInput, 0789850898{Tab}
SendInput, american{Tab}
return
!w::  ; radwan
SendInput, John{Tab}
SendInput, Peterson{Tab}
SendInput, 133718{Tab}
SendInput, Johnpeterson@gmail.com{Tab}
SendInput, 0789850898{Tab}
SendInput, american{Tab}
return
!e::  ; radwan
SendInput, John{Tab}
SendInput, Peterson{Tab}
SendInput, 133718{Tab}
SendInput, Johnpeterson@gmail.com{Tab}
SendInput, 0789850898{Tab}
SendInput, american{Tab}
return
!r::  ; radwan
SendInput, John{Tab}
SendInput, Peterson{Tab}
SendInput, 133718{Tab}
SendInput, Johnpeterson@gmail.com{Tab}
SendInput, 0789850898{Tab}
SendInput, american{Tab}
return
its essentially 15 copy of the above code, each with different string inputs for different student the goal is to use a hotkey to fill out a google form with 1 hotkey stroke
I have repeated the same line of code, changing the assigned key each time, !q,!w,!e, etc for each group of information
first of all is this the most efficient way to code this?
secondly, everytime I run the code on a google form, sometimes the "tab" is run before or after the text, in which I wll get instances where "JhonPet" is typed in the first section and "erson" is typed in the second section

Re: Inconsistency running my script  Topic is solved

Posted: 18 Jan 2022, 17:37
by mikeyww
There are so many different ways to do it. I think it depends on your workflow and preferences. With only 15 entries, you don't have to worry about big differences in efficiencies across the possibilities. One can use an INI or CSV external file, hard-code into the script with an array, use some other variables, leave as is, etc.

Regarding the letter mixups, in some cases, Send can be better than SendInput, because it builds in a delay after every character. You can then adjust the delay if needed. I have some Web automations where I need a SetKeyDelay greater than the default of 10 ms.

Re: Inconsistency running my script

Posted: 18 Jan 2022, 19:56
by hotsku11er
what if i want to modify the code into the following

Code: Select all

!q & 1::  ; radwan
SendInput, Bob {Tab}
Sleep 60
return

!q & 2::
SendInput, the builder{Tab}
Sleep 60
return

!q & 3::
SendInput, 133718{Tab}
Sleep 60
return

!q & 4::
SendInput, bob@yahoo.com{Tab}
Sleep 60
return

!q & 5::
SendInput, 07841526{Tab}
Sleep 60
return

!q & 6::
SendInput, spanish{Tab}
return
In which I want alt + q + num , to send 1 line of info, and mapping a different number to each line of information, but when reading the AHK help it mentions that 3 key hotkeys are not supported what do you think is the best method to approach this?

Any info is very much appereciated

Re: Inconsistency running my script

Posted: 19 Jan 2022, 06:19
by mikeyww
Try the middle example from that same paragraph about custom combinations.