• 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: This worked yesterday: File path question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: This worked yesterday: File path question


  • Subject: Re: This worked yesterday: File path question
  • From: Ted Wood <email@hidden>
  • Date: Thu, 14 Dec 2000 20:32:08 -0800

File path issues confound me.

A longish script containing the line;
open file "G4 HD:MSO Show Log database:CD log project copy 1"
stopped working, giving me a -120 error. This is a script I use several
times a week.

Changing to "open file alias..." got it to start working again.

I don't think that I moved the location of the file I'm pointing to, so I'm
confused. BTW, another file referred to in the same folder wouldn't work
properly till I changed it to an alias reference.

Is it best to always use the alias reference, even if you think the file
isn't going to move?


Preston Smith
Perfect Record
St.Paul, MN USA
email@hidden
Sound for CD * DVD-A * Sound for Broadcast * Mastering * Editing

Yes, Preston, it is best to use an alias reference. It's the most flexible form of a reference you have in AppleScript since it understands them directly, whereas Finder references don't mean anything to AppleScript. Just so you know, a direct alias specification (alias <file>) needs to point to a file that already exists in order for the script to compile. If the file may or may NOT exist, use the (<file> as alias) form. This will still create an alias which can be used in the rest of the script, but the file doesn't need to exist in order for the script to compile.

BTW, you can omit "file" from the "open file alias <file path>" line. Hopefully, you'll already be pointing to a file, as opposed to a folder or an application, so the explicit distinction doesn't need to be made.


References: 
 >This worked yesterday: File path question (From: Preston Smith <email@hidden>)

  • Prev by Date: Re: Porting shell script to AS
  • Next by Date: Re: Newbie Progress Bar
  • Previous by thread: This worked yesterday: File path question
  • Next by thread: Re: This worked yesterday: File path question
  • Index(es):
    • Date
    • Thread