Created
January 9, 2012 01:07
-
-
Save mlhaufe/1580376 to your computer and use it in GitHub Desktop.
SendKeys + Sleep + VBScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<!--Reference <http://www.visualbasicscript.com/tm.aspx?high=&m=95682&mpage=1#95682> --> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>Send Keys</title> | |
<script type="text/vbscript"> | |
Sub Sleep(intTimeWait) | |
Dim Shell : Set Shell = CreateObject("WScript.Shell") | |
Shell.Run "%comspec% /c ping.exe 127.0.0.1 -w 1000 -n " & _ | |
intTimeWait + 1, 0, True | |
End Sub | |
Sub BtnRun_OnClick() | |
Dim WShell : Set WShell = CreateObject("WScript.Shell") | |
With WShell | |
.Run "notepad" | |
Sleep 1 | |
.AppActivate "notepad" | |
.SendKeys "Hello World!" | |
Sleep 3 | |
.SendKeys "{ENTER}Hola Mundo!" | |
End With | |
End Sub | |
</script> | |
</head> | |
<body> | |
<button id="BtnRun">Do It</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment