Search code examples
c#javascriptsleepscriptcontrol

Is it possible to sleep in JScript executed by C# MSScriptControl.ScriptControlClass?


I'd like to be able to sleep in a JScript executed by C# MSScriptControl.ScriptControlClass. I thought that maybe the WScript.Sleep() function might be available, but I'm getting a "WScript is undefined" error message when trying that. I'm new to scripting outside of a web browser. I thought that MSScriptControl.ScriptControlClass and Windows Script Host might be related, but maybe they're not. If there isn't a sleep function that is available to the script, then what's the next best thing?


Solution

  • There is no sleep function within javascript, maybe you can write a COM executable with implemented sleep-function or find one, which already has this function.