Re: Coercion question
Re: Coercion question
- Subject: Re: Coercion question
- From: Jan Pieter Kunst <email@hidden>
- Date: Fri, 15 Jun 2001 17:49:32 +0200
Michelle Steiner (email@hidden) schreef op 15-06-2001 16:05 :
>
> Hello all,
>
>
>
> Is it possible to coerce this:
>
>
>
> alias "Disk:Folder:File"
>
>
>
> to this:
>
>
>
> {file "File" of folder "Folder" of startup disk}
>
>
tell application "Finder"
>
set foo to the selection as alias list
>
set bar to file (item 1 of foo)
>
>
-->folder "PhotoDeluxe 2.0" of folder "Graphics" of startup disk of
>
application "Finder"
>
>
class of bar
>
>
--> folder
>
>
end tell
Thanks, I made something based on this (the variable x is always a single
alias):
tell application "Finder"
if class of file x is folder then
-- do folder stuff
else
-- do document stuff
end if
end tell
This seems more elegant to me than the other solution involving checking for
the last character of the alias as string being a colon or not. I haven't
checked which one is faster though.
JP