AutoHotkey Community

It is currently May 27th, 2012, 5:24 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: February 3rd, 2011, 6:58 am 
Offline

Joined: October 12th, 2010, 9:23 am
Posts: 132
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 5th, 2011, 4:21 am 
Offline

Joined: June 8th, 2006, 10:17 pm
Posts: 36
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}


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], HotkeyStick, rbrtryn, XstatyK, Yahoo [Bot] and 85 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group