• 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: Why doesn't 'alias' error when the file no longer exists?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why doesn't 'alias' error when the file no longer exists?


  • Subject: Re: Why doesn't 'alias' error when the file no longer exists?
  • From: "Eric Grant" <email@hidden>
  • Date: Mon, 18 Dec 2000 11:19:25 -0800
  • Organization: http://www.eagrant.com

Paul Berkowitz <email@hidden> wrote:

> The test that works is:
>
> try
> get alias (theFile as string)
> on error
> display dialog "Squawk!"
> end try
>
> That must force the script to try to resolve (is that the word?) the alias
> afresh. If it exists, all is well, if it doesn't, the error trap works.

> Why does it give the result
>
> get theFile
> -- alias "Hard Disk:Some Folder:Some File"
>
> when there is no such thing?

In general, just "getting" a variable does nothing -- it is a literally
useless action. So, as you surmised, "getting" an alias does not resolve
the alias. You must actually use the alias (such as by coercing it to a
string) for it to be resolved.

Cheers,
Eric


  • Follow-Ups:
    • Re: Why doesn't 'alias' error when the file no longer exists?
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: OT: VPN clients/protocols
  • Next by Date: Re: Why doesn't 'alias' error when the file no longer exists?
  • Previous by thread: Re: OT: VPN clients/protocols
  • Next by thread: Re: Why doesn't 'alias' error when the file no longer exists?
  • Index(es):
    • Date
    • Thread