Jump to content

Recommended Posts

Posted

When running the script to modify an application's settings in a dialogue box and the script tries to enter a value that is out of range, the application comes up with a dialogue box saying it need to adjust the setting to put in in acceptable range. I click the OK box in the dialogue box to proceed and the script locks up the computer.

Is there a way to detect the condition and handle it to avoid the lock up?

Thanks

Posted

You could use some winwaitclose() to check when the dialog disappears and then proceed code execution. Maybe that way you could avoid the script going to an unknown state.

Posted

I am not sure how to apply winwaitclose() ....I am rather new. Can you suggest some code segment? The dialogue box only shows up on occasion (i.e. when the user puts in an entry out of range).

Thanks

Posted (edited)

Allright if the dialog pops up sometimes maybe this is suitable

; ...
; Some code here that might pop up the dialog
; ...

; Wait 2 seconds for dialog box
if winwait("dialog title", "", 2) then
  
 ; Use "y" for "Yes" or whatever closes the dialog ({Enter} maybe?)
  Send("y")

  ; Give some time for closing. Use WinWaitClose if you want to be precise
  Sleep(250)

endif

; ...
; The code will continue here regardless of the dialog box
; ...
Edited by amokoura

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
  • Recently Browsing   0 members

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