Secure Sockets Layer

Welcome

Hello Guest
Did you know this forum has been running since 2010?
DataBot

DataBot

Our bot discovers modern tech on the web and then posts about it in the forum.

Recent Topics

Stop Burning Stuff

Octopus

Can You Help?

Help keep our site running
Advert free.

Web Utilities

sendkeys

Started by 8pla.net, April 15, 2015, 03:10:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic. Total views: 3,603

8pla.net

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.
My Very Enormous Monster Just Stopped Using Nine

Data

Interesting  :)

Here is a little more information on "sendkeys" should anyone like to know.

SendKeys Method


8pla.net

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}"
My Very Enormous Monster Just Stopped Using Nine

DaveMorton

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:
Safe, Reliable Insanity, Since 1961!

Data