Re: Damn send button / Wind chill
Re: Damn send button / Wind chill
- Subject: Re: Damn send button / Wind chill
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 02 Mar 2002 21:55:11 -0800
On 3/2/02 9:19 PM, "Shane Stanley" <email@hidden> wrote:
>
On 3/3/02 8:56 AM +1000, Paul Berkowitz, email@hidden, wrote:
>
>
> You should avoid putting one tell block inside another, which is similarly
>
> wasteful, sluggish and occasionally worse
>
>
Really? Let's say I have a script like this:
>
>
tell application "Finder"
>
name
>
tell application "InDesign 2.0"
>
name
>
end tell
>
end tell
>
>
If I look in the log, I get:
>
>
tell application "Finder"
>
get name
>
--> "Finder"
>
end tell
>
tell application "InDesign 2.0"
>
get name
>
--> "Adobe InDesign"
>
end tell
>
>
That suggest to me that nesting tells to applications is no problem at all.
>
Am I missing something?
>
I never said it didn't work, Shane. I said it was wasteful, sluggish and
occasionally worse. The "wasteful, sluggish" part I've been assured by
people who know how Apple Events work (I think Scott Norton was probably one
of those - I'm sure he'll speak up if I'm wrong). I've seen it in "action"
in labor-intensive repeat loops. Otherwise, it probably doesn't make much
difference on modern machines and OS's, I guess. The "occasionally worse"
would probably just arise if there's a terminology overlap ('file' is one of
those terms that often means different things to different apps). If it
doesn't, it doesn't.
I can't see how you'd go wrong by avoiding nesting application tell blocks.
Can you? Most of the time, nesting them won't have significant negative
effects. But sometimes (long repeat loops) it will be perceptibly sluggish.
And for those admittedly few times when you hit "worse" you can un-nest, I
guess. I just prefer to avoid it in general, and I can't see how that
practice hurts anything. It's almost always possible to come out of one tell
block before entering another, but I can see where it might sometimes be
convenient not to.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.