Re: Coercion question
Re: Coercion question
- Subject: Re: Coercion question
- From: Hugh Dixon <email@hidden>
- Date: Fri, 15 Jun 2001 12:10:37 +0000
On 15/6/01 8:07 am, Jan Pieter Kunst wrote
>
Hello all,
>
>
Is it possible to coerce this:
>
>
alias "Disk:Folder:File"
>
>
to this:
>
>
{file "File" of folder "Folder" of startup disk}
>
Hi Jan,
If the alias ends in a colon, it's an alias to a folder. If it doesn't, it's
an alias to a file (application or document).
So...
if last character of (the_alias as text) is ":" then
display dialog "It's a folder"
else
display dialog "It's a file"
end if
Alternatively you could use info for:
if folder of (info for the_alias) is true then
display dialog "It's a folder"
else
display dialog "It's a file"
end if
Hope this helps.
Hugh
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************