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: Chris Page <email@hidden>
- Date: Tue, 16 Dec 2008 04:57:06 -0800
On Dec 16, 2008, at 9:15 PM, Shane Stanley wrote:
A user double-clicks on an applet that produces an InDesign document
and then comes up with a save dialog; they do the same thing from a
similar script in the Scripts panel. Why should the user experience
have to be a modal dialog in one case and not the other?
I'm not sure what you're asking.
If a script says
tell application "InDesign" to display alert "Hi!"
The ‘display alert’ command will always be sent to and handled within
the InDesign process, no matter which process the script is running in.
If a script says
display alert "Hi!"
without the ‘tell’, it will be sent to and handled within whatever
process is running the script.
If you run this script from within InDesign, the alert will be
displayed in InDesign's process. If you run this script from within a
script applet, the alert will be displayed within the applet's process.
The behavior of scripting commands in general -- not just scripting
addition commands -- depends upon the process they are handled in, and
scripts control where commands are sent and handled.
You're looking at it too much from a programmer's perspective; to a
typical user, that sort of distinction is at best silly and at worst
confusing, not to mention error-prone.
Script writers are programmers. The details may vary, but the act of
coding is essentially the same. And programs written in any language,
even AppleScript, are subject to the same fundamental rules. And one
of those rules is that programs run inside processes, and that program
behavior may vary depending on which process it is running in.
In some ways you have to think of the script and the app its
addressing as being the one thing, because that's often what it
looks like to the user.
And it's my intent to uphold that view when possible, but ultimately
we cannot always do that, for fundamental reasons. It is our challenge
to make it easy to write correct script programs that involve multiple
programs, but it is our duty to not make things worse by attempting to
lie about the underlying reality when they conflict.
--
Chris Page
The other, other AppleScript Chris
_______________________________________________
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