Datahopa
Computer Related => PC Software => Topic started by: 8pla.net on April 15, 2015, 03:10:44 AM
What I like most about VBScript is: sendkeys. JavaScript may be more popular, but VBScript is such a powerful beast. Using the sendkeys syntax, we get to automate the usage of applications, in terms of starting them up and getting them to do things automatically, completely hands off on the keyboard and mouse.
Interesting :)
Here is a little more information on "sendkeys" should anyone like to know.
SendKeys Method (http://www.pctools.com/guides/scripting/detail/149/?act=reference)
This code is untested, because I am not on Windows.
So for that reason, it is posted for discussion purposes
only. But, this is some of what I used to do with sendkeys.
' Start Notepad
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "notepad", 9
' Let it finish loading...
WScript.Sleep 500
' Start typing without touching the keyboard
WshShell.SendKeys "Datahopa is fun!"
WshShell.SendKeys "{ENTER}"
I copied the text and pasted into Notepad, saving it on the desktop as dh.vbs - I then ran the script, and it behaved just as intended. Well done, 8-Man! :thumbsup:
Gets my approval ;D