With SendKeys you simulate user keystrokes – which mean it is possible to start applications, enter information, choose menus, buttons etc.
SendKeys is a part of Windows Script Host.
Currently I am using this functionality to take over a second Navision Client, to start an export of objects without any user interventions.
In Navision SendKeys are found in the automation Windows Script Host Object Model class WshShell.
The first thing to do is to create the automation:
IF ISCLEAR(WshShell) THEN
Activate the application which has to behandled:
And then send the keys:
WaitForKeys := TRUE;
When you are finished sending keys then stop the automation by clearing it:
Pretty simple – right 🙂