Re: Quirk coercing aliases to strings
Re: Quirk coercing aliases to strings
- Subject: Re: Quirk coercing aliases to strings
- From: Michelle Steiner <email@hidden>
- Date: Fri, 31 Aug 2001 06:29:24 -0700
On 8/30/01 5:16 PM, Brennan <email@hidden> wrote:
>
I just discovered this:
>
>
>
set theFile to (choose file)
>
set n to "test"
>
set newPath to file ((theFile as string) & ":" & n)
Hmm. What I get is this:
>
get file "Dora:Birth Certificate:test"
>
--> Can't make some data into the expected type.
>
Actually, I would have expected an error for treating 'A File' as a folder.
Which is what I got. I tried it with files on the desktop and files
inside the disk icon, with application, document, and alias files--all
with the same result.
>
This can be confirmed by
>
>
set newPath to file ((theFile as string) & "::" & n)
>
>
Which will return
>
>
"Macintosh HD:test"
>
>
More colons will take you further, if you have further to go.
Yes; this is already known.
alias ":" will return the folder containing the application that runs the
script; adding colons goes up the chain towards the root.
>
Try this version to see it even more clearly:
>
>
set theFile to (choose file)
>
set n to "test"
>
set str to (theFile as string)
>
set nn to (str & ":" & n)
>
log nn
>
set ePath to file nn
I still get the same error.
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------