VBScript and Key down syntax

5 pts.
Tags:
VBScript
VBScript Statements
I am trying to run this program below. The portion that is commented out (the if statement) is not working. Obviously I've got the wrong syntax or it's not possible. What I'm trying to do is to click F10 every 12 seconds until I hit the escape key, or until it has gone through it the number of times I have set in the counter. It all works except for the escape key part. Any help would be greatly appreciated. Thanks, Pat
____
Option Explicit
Dim wshShell
Dim intCount
Set wshShell= CreateObject("WScript.Shell")
WScript.sleep 1000
intCount=0
Do While intCount <= 25
   WshShell.SendKeys "{F10}"
   WScript.Sleep 12000
   intCount = intCount + 1
  'If keydown=chr$(27) then
  '   intCount = 25
  'End if    
                  
Loop
WScript.Quit


Software/Hardware used:
VBScript, PC, Windows 7

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: