Re: Simple folder walk...I think
Re: Simple folder walk...I think
- Subject: Re: Simple folder walk...I think
- From: Jon Pugh <email@hidden>
- Date: Fri, 16 Aug 2002 16:26:29 -0700
At 1:54 PM -0600 8/16/02, Doug McNutt wrote:
>
I would appreciate some generalized discussion about whether "alias" is, or is not, a finder class and whether your repeat block above uses the finder in spite of what you think you're asking. What are the true speed advantages of executing "within AppleScript" as above?
Aliases are not part of the Finder and the referenced loop does not use the Finder at all. An alias is a simple data record, a stream of bytes if you will, that the Mac Toolbox knows how to use. Any application can use aliases and most do in some form or another.
You can feed an alias to the Finder and it will know how to use it.
The Finder objects that can be resolved outside of the Finder are Finder object specifiers, typically displayed like so:
item "Akbar" of folder "Jeff" of startup disk of application "Finder"
Most of the time you leave off the application part because you are inside a tell block, so it is added automatically. However, if you use this outside of a tell block it will still be sent to the Finder when it needs to be evaluated.
That's the only case where you don't need a tell block that I know of.
As for why the speed advantage, that's simply because sending messages to another app is relatively slow. Avoiding cross application messages speeds up your scripts, especially unnecessary cross application messages. This is one reason you should avoid putting scripting addition calls in tell blocks. Most of the time they aren't needed and simply slow things down. In other cases they allow terminology conflicts between the scripting addition and the application, while in other cases you need to run a scripting addition in the context of another application (like when putting up a dialog via "display dialog").
Jon
_______________________________________________
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.