I am automating a process that uses a LOOP.
The script runs through a few chores, entering info on a website and then tries to download information via a button that is available only if data is available; clicking on it brings up a dialog box. If a dialog box does NOT appear after a few seconds from the click, I want the script to increment the loop and begin at the top of the loop section (i.e. assume that now download is available).
For whatever reason, I simply cannot get this to work correctly...
Here is the section with the problem:
Code:
;select Download Manager
MouseClick, Left, %xDownloadMgr%, %yDownloadMgr%
WinWait, Windows Internet Explorer, 3
If ErrorLevel continue ;goes to the next loop, skipping the below
Send, {SPACE}
WinWait, File Download
Sleep, 0.5 * 1000
Send, {LEFT}
Sleep, 0.5 * 1000
Send, {SPACE}
The window that I am testing for is simply a dialog box that pops up titled only "Windows Internet Explorer" with the words "are you sure you want to navigate away...". Is there an alternate test I can try? Am I using the LOOP's "continue" correctly (which seems counterintuitive, since it is more like a skip than a continue)?
If I omit the 3 second timed test and the error test, then the whole thing works fine, until, of course, the situations when the dialog box does not appear.