正如我在问题标题中所问的那样,当我必须多次发送该密钥时,如何避免重复键入密钥。
下面是我的 Batch-VBScript 混合,为了发送{DOWN}
密钥 4 次,我尝试了下面的代码,但它不起作用?:
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
我怎样才能达到我想要的?