I'm looking for a way to make the WaitForIdle (or equivalent function, even a custom one) work on a JScript macro.
What I'm trying to achieve is to pause the application (not make it "sleep", as I've already done with custom code) in order to select a value on a field and give time to the application to "update the layout" with the selection before taking a screenshot.
Currently with the lone sleep the screenshot is taken before I can see the layout update.
Do you have any hint about how to do this in JScript?
Sorry for the very late answer, I had literally no time
Anyway, this is what I discovered:
Thanks to everyone for the help!
Hi Sinan, thanks for your reply
I've already tried that (only difference is the Application.Msgbox instead of the alert) but it's not working... When I use it opens the Edit Module and does nothing at all!
I'm not sure about how to use them, using directly
Do I need to import anything? If not, could you make a working example, please?
Apart from this, the only way is to use setTimeout() as far as I know.
Tried that, but including it in the module gave me many errors: on the WinJS base/ui file there are many strings that ends with a ",", which I'm not sure about... Of course the parser gives me error, and I think they are wrong too... but I hope they left them there for a purpose
Still no luck with setTimeout, but thanks for trying
Let's see if anybody else has an idea/workaround for my problem
Here is how you can use InputBox and MsgBox from JScript:
personName = qvlib.InputBox("What is you name?")
msg = "Hello " + personName + " !"
Hi Petter, thanks for your reply,
I've tried it and it works, but I don't think this example is the best one... When you use a MsgBox or something else where you need the user to execute an action (in this situation click the "ok" button to proceed with the execution of the macro) you stop the execution, so it's not like having it scheduled...
Anyway I found the solution to my problem, I'll post it later