Re: This worked yesterday: File path question
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.