Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Precise Delays in an AHK Script


  • Please log in to reply
2 replies to this topic
rjschilling
  • Members
  • 16 posts
  • Last active: Feb 13 2013 07:45 PM
  • Joined: 20 Dec 2012

Here's my script, as it currently stands,

right::
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;DSLAM Audit > Customers
    WinActivate, DSLAM Audit
    send ^c
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    WinActivate, Aquarium 5.1.0 : Customer View - Mozilla Firefox
    click 1000, 175                     ;265,419  ;
    send ^v
    send {enter}
    MsgBox,0,Pause,Hello,5
    MouseClickDrag, right, 7,190, 219,190
    send ^c
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    WinActivate, DSLAM Audit
    send {tab}
    send ^v
    send {tab}{tab}    
return

 

I'm using a send {enter} command in an AHK script to open a new webpage in my browser.  My problem is that the commands following this this command in my script execute before the desired webpage is open.  I added the command MsgBox,0,Pause,Hello,5 to my script to delay the execution of these commands and provide time for the webpage to open.  Is there a better way to do this?
5 seconds seems to be more than enough time but I suppose that it might not be enough time under certain  circumstances.  Is there is a command that that would cause the script to continue only precisely after the  desired webpage has opened?

Thanks and many kind regards - Randy

 

 

 


guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011

if the new page becomes active and changes the title bar, then yes:

 

WinWaitActive

http://www.autohotke...nWaitActive.htm

 

although you can look at the other WinWait* commands as well

 

again, best to post these questions in the Support forum. this Programming forum is actually for discussion of other languages



rjschilling
  • Members
  • 16 posts
  • Last active: Feb 13 2013 07:45 PM
  • Joined: 20 Dec 2012

ok and thanks - Randy