Post Reply

Forums -> UltraMon™ -> Script used to run keystrokes
Brandon   2018-01-11 11:56
Is there a script that can send keystrokes to the currently active window as if they were typed from the keyboard?

Thank you,

Brandon
Christian Studer   2018-01-11 14:45
VBScript supports this, you don't need UltraMon for this.

Here's sample code which sends CTRL+O to the active window, for example in Notepad this will open the File Open dialog:

Set sh = CreateObject("WScript.Shell") WScript.Sleep 200 'wait for 200 milliseconds sh.SendKeys "^o" 'send CTRL+O

The short wait on line 2 was necessary on my system, might not be needed on your system.

For more on SendKeys see MSDN.

Christian Studer - www.realtimesoft.com
Brandon   2018-01-12 11:34
Perfect, thank you!

Brandon
Forums -> UltraMon™ -> Script used to run keystrokes

Post Reply