• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Quirk coercing aliases to strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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. |
----------------------------------------------------------------------


  • Prev by Date: Using tray of printers
  • Next by Date: Re: Getting running status of an application
  • Previous by thread: Quirk coercing aliases to strings
  • Next by thread: TIDS are? - a script for displaying the current value
  • Index(es):
    • Date
    • Thread