Some time I need to incorporate a sleep space in my scripts.
For example
Sub WaitUntilFileIsReady(filePath)
Dim size1, size2
size1 = objFSO.GetFile(filePath).Size
Do
WScript.Sleep 500 ' Espera medio segundo
size2 = objFSO.GetFile(filePath).Size
If size1 = size2 Then Exit Do
size1 = size2
Loop
End Sub
But I get error in the execution. How can I solve this situation? Any suggestion?
Thanks
Again I have to load a script with a function WScript.Echo
I get that "WScript is not defined"
I suppose the problem is the same as with WScript.delay
My question is : How can I find the DOPUS equivalent for WScritp function? Is there a function search somewhere? What do you suggest for a dummy on this issue?
Thanks
Sorry. Can you be more specific? with an example please.
Previously @leo make this comment
I thought that I should try to find DOpus objects instead of trying to unse WScript.
May be I didn't understand really what he wanted to tell me.
I am not fully english talking, neither strong programmer. Just advanced it user. Thanks.
Scripts run underneath a host. Hosts can provide objects to the script for it to use.
When you run a script within Opus, Opus is the host. Opus provides an object called DOpus (and another one called Script).
wscript is a program that comes with Windows that also lets you run scripts. When you run a script from wscript.exe, it provides an object called WScript.
You can't access the WScript object unless you run the script from wscript.exe, just like you can't access the DOpus object unless you run the script from Opus.