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 13:56:02 -0800
On 3/1/02 3:37 PM, "email@hidden" <email@hidden> wrote:
>
As for Paul's comment about wrapping it all in a Finder tell block, it is a
>
habit I do with any stand-alone script that doesn't interface with anything
>
else (or that just interfaces with files/time/system calls). Paul, is this
>
wrong for some reason?
Sending Apple Events to an application, then to AppleScript, is wasteful and
consumes CPU cycles and RAM, slowing everything down. It's a totally
inefficient way of doing things. The Finder pre-OS X is the worst culprit of
all, by a very long way, and is quite likely to bog down any repeat loop
thrown at it. Furthermore, if you happen to have 'path to desktop' in a
Finder block, it gives you the wrong answer.
You should avoid putting one tell block inside another, which is similarly
wasteful, sluggish and occasionally worse, and avoid putting commands that
go to AppleScript or scripting additions like Standard Additions into a
Finder or any other application tell block, unless there's a good reason
(such as needing to work with some application objects, when of course it
would be necessary.)
What possible reason could there be for putting commands which calculate
numbers into a Finder tell block? This is probably a bad habit picked up
from your first steps in AppleScript when, like almost everyone, you tried
out a few simple scripts by recording in the Finder. When you record,
everything is in a Finder block, and everything is always 'activated'. Those
are the first things to cut out when you take up "real scripting".
--
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.