• 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: File or Alias?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File or Alias?


  • Subject: Re: File or Alias?
  • From: "Marc K. Myers" <email@hidden>
  • Date: Fri, 02 Feb 2001 10:09:08 -0500
  • Organization: [very little]

Pier Kuipers wrote:
> Date: Fri, 2 Feb 2001 12:21:41 +0000
> To: Applescript Mailing List <email@hidden>
> From: Pier Kuipers <email@hidden>
> Subject: File or Alias?
>
> I seem to be experiencing intermittent problems with several scripts
> that refer to files in the finder. What I mean is, a script that
> usually runs without problems may one day decide to produce an error.
> For example:
>
> -- Script must be run from the Apple or OSA menu
> tell application "Finder"
> set theArchive to (selection as alias)
> tell application "ApplicationName" to open file theArchive
> end tell
>
> As far as I remember, this used to work fine, but now causes an Apple
> Event error. The problem is easily rectified by changing the second
> tell statement to
>
> tell application "ApplicationName" to open theArchive
>
> in other words, leave out the "file" bit. What is going on? I did
> update my system software recently (from 9.0 to 9.0.4), but surely
> that shouldn't cause this type of problem?
> Any help greatly appreciated.

I don't know how the first example could have ever worked. You've set
"theArchive" to an alias reference in line one, so in the second you're
saying 'open file alias "someThing"'. A file reference require a text
value as its object, not an alias reference.

In the second example you're opening an alias, which works as expected.

Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074

[2/2/01 10:07:56 AM]


  • Prev by Date: considering/ignoring in QuarkXPress
  • Next by Date: Re: AppleWorks formatting and Glossary
  • Previous by thread: File or Alias?
  • Next by thread: Re: Cookies and cgi
  • Index(es):
    • Date
    • Thread