I have an app that uses dialog tool kit in a repeat loop. It displays the dialog tool kit window, and if the user does not interact it gives up after a set number of seconds, then repeats (each time with updated info).
It works perfectly, until some time after the mac goes to sleep (but not immediately) the script throws an errorL
‘'AppleScript Execution Error
User interaction disallowed’
So it seems like either the giving up, or displaying the window, is seen by the mac as user interaction when the mac is in sleep mode.
Any suggestions on how to avoid this? I simply trap for the error, if it’s unavoidable.
Ed, I guess you’ve checked the Accessibility settings.
I sometimes get that error when my applet is not frontmost and it’s code tries to do something. Only solution I’ve found so far is to add “tell me to activate” before code which does something.
Thanks, Garry, It’s strange, the activate command only delays the error by a few minutes.
Accessibility settings are updated and correct. This only happens a few minutes after the mac has gone to sleep, but not right away after sleep begins.
I assume you’re using the “giving after” command for this.
It simply dismisses the window.
Do you explicitly quit your application to ensure it’s not continuing to run? (or generate error -128)
Yes I do use giving up after, but, no, the app doesn’t quit.
The dialog is in an endless repeat loop and and if the user doesn’t interact in time the dialog closes, the app does it’s next iteration of processing and displays a new dialog.