Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
!s:: ;select window to send to
ControlGet,v_h,Hwnd
return
!c:: ;check the window selection
MsgBox "The selected window has Hwnd " %v_h%
return
!q:: ;send the keys to selected window
ControlFocus,,ahk_id %v_h%
Loop, 9
{
ControlSend,,s,ahk_id %v_h%
Sleep, 500
}
return