Re: Tell Blocks Considered Harmful (was Re: open for access)
Re: Tell Blocks Considered Harmful (was Re: open for access)
- Subject: Re: Tell Blocks Considered Harmful (was Re: open for access)
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 16 Dec 2008 12:18:23 -0800
- Thread-topic: Tell Blocks Considered Harmful (was Re: open for access)
On 12/15/08 11:02 PM, "Chris Page" <email@hidden> wrote:
> On Dec 15, 2008, at 9:05 PM, Paul Berkowitz wrote:
>
>> Oh, I finally see what you mean.
>>
>> No, that would be a disaster.
>
>
> Heh. Okay. Which brings me back to my original question: Why? When and
> why does it matter which application displays the dialog?
I have several scripts which run as applets and script another application,
or even more than one (e.g. Address Book and Microsoft Entourage). My main
issue is being able to bring the dialog to the front via an activate,
sometimes I want to have the relevant application (e.g. Entourage) visible
behind and not let the user tinker with it until he dismissed he dialog.
I am trying to think if the same could be achieved, without loss of any
function, by being able instead to specify (as an option) that the dialog be
system-modal (floating above all windows). In one way, that would be even
better, since the dialog could not be covered up by the user choosing to
activate a different application manually. (I sometimes use a 3rd-party osax
that achieve this for exactly this reason). That, however would not prevent
the user from messing with the scripted application while the dialog is up.
If an option also allowed for application-modal, that would solve that
problem, in the same way as at present. (I wonder if here would be some way
to do both?...)
I'm trying to think of a downside, but at the moment I don't see any, aside
from the one mentioned by Ed that it would be awkward for new scripters to
learn how to remove osax commands from within tell blocks. (For myself,
rather than 'tell me' I might get into the habit of calling a standard
DisplayDialog(thePrompt, theButtons, ...) handler.) I think that's got to be
the main objection - the nuisance of common osax calls requiring laborious
workarounds. I think you'd need to bring all of Apple's own Standard
Additions into the AppleScript language so that they "just work" and don't
break a million existing scripts. (Could this even be done for
user-interactive commands such as display dialog?) Third-party osaxen would
be the losers here, for existing scripts anyway. It would make them think
twice about changing to FBAs for sure, since an internal 'tell application
"FBA"' might actually be easier than scripters pulling them out of
application tell blocks.
--
Paul Berkowitz
_______________________________________________
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