stevel wrote:
I'm close to 100% sure why my above script fails (I have repaired similar errors many times). The Send command, which simply switches to any other window than firefox, is not completed before the winactivate command which is then skipped but by the time the winwaitactive command starts the window has changed, hence the hangup. That's why the 'Sleep' command, when inserted after the Send command, solves the problem. I have found timing errors like this appear randomly (though not too frequently) due to system speed depending on what else is running. I don't know if there is any real solution to the problem except sleep delays and possibly loops.
stevel wrote:
I'm close to 100% sure why my above script fails (I have repaired similar errors many times). The Send command, which simply switches to any other window than firefox, is not completed before the winactivate command which is then skipped but by the time the winwaitactive command starts the window has changed, hence the hangup. That's why the 'Sleep' command, when inserted after the Send command, solves the problem. I have found timing errors like this appear randomly (though not too frequently) due to system speed depending on what else is running. I don't know if there is any real solution to the problem except sleep delays and possibly loops.
I have the same experience e.g. after activating a Firefox window, I want to search for this string: Click on Summary
this should work, but doesn't due to timing, since send completes before the page refresh is done and winwaitactive doesn't seem to wait for the window to be active:
WinWaitActive, Mozilla
WinActivate, Mozilla
send, /Click on Summary
instead, these steps are needed:
send, ^f
send, Click on Summary
sleep 3000
send, {Enter}