i have a very simple to send keystrokes into chrome but i wanted to ask for help to make it shorter but i am an absolute noob to figure out, how..
Basically its repeating
S, G, L and backspace 10 times
Y single time
A, G, L and backspace 10 times
X single time
And another issue i got is, that my script stops at the final end but it should infinite loop until i quit manually.
Any help is appreciated and thanks in advance.
BR
Code: Select all
^q::
#Persistent
SetTimer, noafk, 1000
return
noafk:
WinGet, winList, List, ahk_class Chrome_WidgetWin_1
Loop % winList
{
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , s,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , s,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , s,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , s,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , s,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , s,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , s,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , s,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , s,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , s,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , y,% "ahk_id " winList%a_index%
Sleep, 450
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , a,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , a,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , a,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , a,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , a,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , a,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , a,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , a,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , a,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , a,% "ahk_id " winList%a_index%
ControlSend, , g,% "ahk_id " winList%a_index%
Sleep, 1200
ControlSend, , l,% "ahk_id " winList%a_index%
Sleep, 500
ControlSend, , {Backspace},% "ahk_id " winList%a_index%
Sleep, 600
ControlFocus, , % "ahk_id " winList%a_index%
Sleep, 450
ControlSend, , x,% "ahk_id " winList%a_index%
Sleep, 450
}
return
Escape::
ExitApp
Return