Re: Object types
Re: Object types
- Subject: Re: Object types
- From: Emmanuel <email@hidden>
- Date: Tue, 16 Jul 2002 22:44:39 +0200
At 8:45 PM +0200 15/7/02, Frank Renner wrote:
>
When I look into the
>
application directories, I find strange descriptions like "folder, by
>
numeric index, by ID, by name". Still I cannot understand why
>
>
set the source_folder to choose folder
>
set item_list to list folder source_folder
>
>
works fine and
>
>
set the source_folder to folder "New Folder"
>
set item_list to list folder source_folder
>
>
So what is the object type of a folder and how can I make a string with
>
a pathname to a folder?
>
>
Where can I get a type list of all the elements of an applications
>
directory and how they can be converted into each other?
Maybe (and my apologies if I'm wrong here) your problem is that you are not
paying enough attention to what Finder's dictionary says. It says that you
can address a folder by index, Id or name, yes, but as an element of some
container. This means that you could say (within a "tell application
"Finder" " block, of course)
------------------------- untested
folder "New Folder" of desktop
-------------------------
or
------------------------- untested
folder 22
-------------------------
(here, I use the fact that "folder" is also listed as an element of the
application)
or
------------------------- untested, you're kidding or what?
folder 22 of folder "Applications" of folder id 2234 of startup disk
-------------------------
(here, example of "by index", then "by name", then "by id" - you cannot
guess ids, you have to "get" them first)
Now, you're right, what you may and may not ask in terms of coercions is
not very clear. Dictionaries don't give the information, I think. Finder
can coerce any of the three types into any other, strings, file references
(file "Macintosh HD:Applications:SurfWriter") and aliases (alias "Macintosh
HD:Applications:SurfWriter").
Just an additional tip: the only way to address a non [yet] existing file
is the file reference.
Emmanuel
_______________________________________________
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.
References: | |
| >Object types (From: email@hidden (Frank Renner)) |