Re: alias is folder?
Re: alias is folder?
- Subject: Re: alias is folder?
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 27 Apr 2003 19:34:48 -0700
On 4/27/03 6:58 PM, "Christopher Nebel" <email@hidden> wrote:
>
On Sunday, April 27, 2003, at 10:35 AM, matt neuburg wrote:
>
>
> On Sun, 27 Apr 2003 01:58:34 +0100, John Delacour <email@hidden> said:
>
>
>
>> tell app "Finder" to kind of (path to "cusr") is "Folder"
>
>
>
> Actually,
>
>
>
> kind of myAlias is "Folder"
>
>
>
> works. The clue I needed is that there's a "kind" property. Thx - m.
>
>
Of course, it won't work unless you run in English. For example, in
>
French, the kind of myAlias is "Dossier". A more reliable approach is
>
this:
>
>
tell application "Finder"
>
get class of item myAlias --> folder
>
end tell
Does 'item myAlias' always coerce the alias to a file path/ To be safe
aren't we back to my version JD found too verbose?
tell application "Finder"
get class of item (myAlias as Unicode text) --> folder
end tell
Some of the classes of files are quite peculiar (the most unlikely things
seem to be 'document files'). That's why my original script here just asked
for;
tell application "Finder"
exists folder (myAlias as Unicode text)
end tell
because the equivalent for 'file'
exists file (myAlias as Unicode text)
works OK, whereas trying to get the class of an item to see if it's a file
does not have a satisfactory method, as far as I can see (yet). There seem
to be various type of classes which come up for various kinds of file.
'file' (in the Finder) seems to be some kind of superclass, like 'item',
which do not generally appear as the result when you ask for the class of an
item.
--
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.