Jump to content

Error Handling When value out of range is entered


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
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...