Re: Simple folder walk...I think
Re: Simple folder walk...I think
- Subject: Re: Simple folder walk...I think
- From: Christopher Nebel <email@hidden>
- Date: Fri, 16 Aug 2002 18:44:42 -0700
On Friday, August 16, 2002, at 12:54 PM, Doug McNutt wrote:
Chris Nebel has said, or at least implied, that AppleScript can and
will use Finder to process classes therein defined even if the request
is outside of a tell block addressed to finder.
Here's the deal: part of an object specifier is the application that
owns the object. Commands whose direct parameter is an object
specifier will be sent to the owning application, regardless of any
tell blocks that are (or are not) in force. For example:
tell application "Finder"
set x to file 1 of disk 2
-- x is now file "Bob" of disk "Stuff" of application "Finder".
end
delete x
-- equivalent to 'delete file "Bob" of disk "Stuff" of application
"Finder",
-- and the command goes to the Finder.
This works with any application, not just the Finder. Technically, the
only reason you need tell blocks at all is to get application-specific
terminology. For instance, try this:
-- Look Ma, no tell block!
set x to window 1 of application "Finder"
get the name of x
Both events get sent to the Finder, because that's where the object
lives.
Somehow AppleScript - or is it the editor - recognizes finder classes.
Script Editor knows very, very little. It's a text editor that can
hand the text off to a magic black box and display the result that pops
out. Typically, the black box is AppleScript, but it doesn't have to
be. People often think that Script Editor *is* AppleScript, but it's
not.
--Chris Nebel
AppleScript Engineering
_______________________________________________
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.