Re: blocking user actions
Re: blocking user actions
- Subject: Re: blocking user actions
- From: Jon Pugh <email@hidden>
- Date: Wed, 17 Dec 2008 14:16:51 -0800
At 1:49 PM -0800 12/17/08, Chris Page wrote:
>That's not too difficult to implement. You can place a translucent (even 100% translucent) window in front of all windows, like Dashboard does, for example.
>
>But how do you relate that to the script and stop the script if the user wants it to stop? That's where it gets tricky.
>
>When a script does display dialog¹ the script waits for the dialog to be dismissed. It doesn't continue running until then. Alternatively, you can write
>
> ignoring application responses
> display dialog "Hi!"
> end
>
>and the script will continue running while the alert is displayed. But, if the user clicks the Cancel button, the script will never know, because it ignored the response.
>
>So, how would we signal the script to stop? Hmm.
The key would be to make it available as an application framework you could embed a script into. Then it wouldn't be modal.
So when the application starts, it runs your script, which calls "block screen". This returns after putting up the window and then proceeds to run the rest of the script. When finished, the script calls "unblock screen" which removes the window.
Since it would need to be an application, it could even remove the block if the script aborted abnormally.
Mark Alldritt talked about adding script application shells like this to Script Debugger. I think he even had a scheme for adding them, but no one ever really wrote any.
Beefing up the default applet shell would be a fine thing for Apple to do though. There's all kinds of scripting support that could be implemented cleanly there, like most of the script additions that we've been discussing here.
Jon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden