Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Translating WSH sample
Message
From
27/07/2001 08:39:11
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Translating WSH sample
Miscellaneous
Thread ID:
00536302
Message ID:
00536302
Views:
39
Can somebody help me translate a sample script from Windows Scripting Host? I am just starting to learn this.

In the documentation, the sample (which you can find under "SendKeys") is as follows:
...
   set WshShell = WScript.CreateObject("WScript.Shell")
   WshShell.Run "calc"
   WScript.Sleep 100
   WshShell.AppActivate "Calculator"
   WScript.Sleep 100
   WshShell.SendKeys "1{+}"
   WScript.Sleep 500
...
I successfully translated the first two lines as follows:
WshShell = CreateObject("WScript.Shell")
WshShell.Run("calc")
But then, I don't know how to translate the third line. Do I need another CreateObject() before I can access WScript, or what?

TIA, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Next
Reply
Map
View

Click here to load this message in the networking platform