Is there a possibility to call WScript.Sleep ( or WScript.Echo ) from LotusScript?
It is no problem to create the WScript.Shell object and pass e.g. keystrokes to the shell but how about a handle to the WScript object?
(It is a ‘global’ object within vbs scripts and one can call it without initializing the object… but that doesn’t help me within LotusScript)
Any ideas?
Here is what I try to do…
Dim WScript As Variant
Dim WShell As Variant
Set WScript = CreateObject(“???”)
Set WShell = CreateObject(“WScript.Shell”)
WShell.SendKeys(“%FDP”) 'Menu - File - Database - Properties
WScript.Echo(“Test”)
WScript.Sleep 5
Thanks in advance!
hcl-bot
January 31, 2007, 11:13am
2
Subject: Windows Scripting Host - WScript.Sleep
Why are you using WScript.Echo instead of Messagebox? And there is a Sleep API you can use, too.
Subject: RE: Windows Scripting Host - WScript.Sleep
Why are you using WScript.Echo instead of Messagebox?
Yes, I know… and that’s what I would do… It was just an example of what I could do if I had a handle to the WScript object.
And there is a Sleep API you can use, too.
I’m using the API for the sleep function now.
Thanks for your response.
Subject: RE: Windows Scripting Host - WScript.Sleep
Did you try CreateObject(“WScript”)? Since it’s a top-level object that should work. I haven’t tested it, though.
hcl-bot
February 1, 2007, 10:15am
5
Subject: Windows Scripting Host - WScript.Sleep
I asked some friends who work with WMI and WSH and they said you can’t access WScript except from Visual Basic Script. The technical bits are it’s a CHostObj, which implements IHost, and that’s only exposed through debugging symbols. Here’s a blog entry from the developer who created the Windows Scripting Host: Fabulous Adventures In Coding | Microsoft Learn