Jump to content

How would I tell a script to wait for a dialog box, but if it doesn't open within a certain time frame, end the script?


Go to solution Solved by Nine,

Recommended Posts

For anyone looking to resolve, here is the code I used:

;Sleep(5000)
;Windows Security Alert
If Not WinWait('Windows Security Alert', "", 30) then Exit
    WinActivate('Windows Security Alert')
    WinWaitActive('Windows Security Alert')
    ControlClick('Windows Security Alert','','[CLASS:Button;INSTANCE:6]')
Sleep(10000)
If Not WinWait('Windows Security Alert', "", 30) Then Exit
    WinActivate('Windows Security Alert')
    WinWaitActive('Windows Security Alert')
    ControlClick('Windows Security Alert','','[CLASS:Button;INSTANCE:6]')
Sleep(2000)
If WinWait('Windows Security Alert', "", 10) = 0 then exit

Exit

 

Link to comment
Share on other sites

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...