As I asked in the Question title, how can I avoid repetitive typing of key(s) when I have to send that key multiple times.
Below is my Batch-VBScript hybrid where in, for sending {DOWN}
key 4 times, I tried the below code but it didn't work ?:
FINDSTR /E "'VbsCode" %~f0 > %temp%\~temp.vbs
CSCRIPT //NOLOGO %temp%\~temp.vbs
Sub TestAppAuto 'VbsCode
On Error Resume Next 'VbsCode
Set WshShell = WScript.CreateObject("WScript.shell") 'VbsCode
WshShell.Visible = False 'VbsCode
WshShell.Run "test.app",0 'VbsCode
WScript.Sleep 500 : WshShell.AppActivate "Test Window Title" 'VbsCode
WScript.Sleep 500 : WshShell.sendKeys "{DOWN}{4}" 'VbsCode
:: Instead of WScript.Sleep 500 : WshShell.sendKeys "{DOWN}{DOWN}{DOWN}{DOWN}" 'VbsCode
End Sub 'VbsCode
TestAppAuto 'VbsCode
WScript.Quit 0 'VbsCode
How can I achieve what I want ?
From Help http://download.microsoft.com/download/winscript56/Install/5.6/W982KMeXP/EN-US/scrdoc56en.exe