Sending Keypresses

 

 

 

Top  Previous  Next

 

You can send any keyboard text to the application. If you need to send special keys like ALT, CTRL, WIN or Function/Arrow keys refer to the list of special key commands. You can also send some special parameters called macros. There is also limited ability to send mouse clicks.

 

Here are some examples of sending key presses, this text is exactly as you would type it in the SendKeys line in System Scheduler.

 

Example 1 - send some simple text.

{WAIT=1000}Here is some text{ENTER}

This example will wait 1 second (1000 milliseconds) to allow time for the application to execute before sending the text "Here is some text" followed by the enter key.

 

Example 2 - automatically create and save a text file.

Here is a new document%FSc:\doc1.txt{ENTER}

Try this with Notepad. This will send the text "Here is a new document", followed by ALT-F (to open the File menu) then S (for Save). The filename C:\DOC1.TXT will be entered into the save dialog followed by Enter to save the file.

 

Example 3 - send the current date as text.

The date today is {[DATE]}

The date yesterday was {[DATE]-1}

The date in mm/dd/yy format is {[DATE],mm/dd/yy}

These three example use the {[DATE]} macro to substitue the date in the text. See macros for more information.

 

Example 4 - reboot your computer (free version)

You can reboot your computer by sending some keypresses. Create a new Application Event, but leave the 'Program' and 'Params' fields blank, as we don't need to run anything. In the 'Send Keys' fields type the following:

 

{WIN}{WAIT=500}u{WAIT=500}r{ENTER}

 

This will cause the computer to reboot by sending these keypresses: {WIN}, this presses the Windows key which causes the start menu to popup, then 'u' to select the Shutdown menu option, followed by 'r' on the shutdown dialog to select Restart finally followed by {ENTER} which effectively clicks the Ok button to reboot the PC.

 

 

Back to Introduction