How to detect whether a modal dialog is blocking mouseclicks
Posted: Tue May 23, 2017 2:31 pm
Is there an elegant way to detect whether a button is unclickable because there is a modal popup present?
(modal = grabs focus and doesn't let go before it is closed again).
The button is visible and enabled, so the script thinks it can go ahead and click the button, when it in fact can not (due to the popup).
A PopupWatcher is trying to handle the popup, but an attempt to click the button is made too early, before the PopupWatcher closes the popup.
Of course, I could insert an excessively long delay to make sure the PopupWatcher always has time to finish, or I could have some loop that repeated tries to click the button until it succeeds, but I was hoping for something more elegant.
is there a smarter way to do this?
(modal = grabs focus and doesn't let go before it is closed again).
The button is visible and enabled, so the script thinks it can go ahead and click the button, when it in fact can not (due to the popup).
A PopupWatcher is trying to handle the popup, but an attempt to click the button is made too early, before the PopupWatcher closes the popup.
Of course, I could insert an excessively long delay to make sure the PopupWatcher always has time to finish, or I could have some loop that repeated tries to click the button until it succeeds, but I was hoping for something more elegant.
is there a smarter way to do this?