redivider Posted June 11, 2014 Posted June 11, 2014 Hello I have a question: I want to send a specific hotkey (say A) as many times as $var1 value is; so if $var1 = 10 it would send A 10 times. How would I go about this? Thanks in advance!
jdelaney Posted June 11, 2014 Posted June 11, 2014 Global $iPressTimes = 10 $iPid = Run ("Notepad") WinWaitActive("[Class:Notepad]") HotKeySet("{HOME}","SendAKey") Func SendAKey() For $i = 1 To $iPressTimes Send("A") Next EndFunc While ProcessExists($iPid) WEnd Example, above IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
redivider Posted June 11, 2014 Author Posted June 11, 2014 Interesting, thanks for the fast response.
Exit Posted June 11, 2014 Posted June 11, 2014 No need for a loop Global $iPressTimes = 10 $iPid = Run("Notepad") WinWaitActive("[Class:Notepad]") HotKeySet("{HOME}", "SendAKey") Func SendAKey() Send("{A " & $iPressTimes & "}") EndFunc ;==>SendAKey While ProcessExists($iPid) WEnd App: Au3toCmd UDF: _SingleScript()
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now