Re: Open files
Re: Open files
- Subject: Re: Open files
- From: Ed Stockly <email@hidden>
- Date: Sat, 16 Mar 2002 15:19:34 -0800
>
>>>So is the file ref needed only for 'write', if that, in that case? Not for
'close access' or 'read'?
File ref is never needed. It's an option for read, write and close. You can
use alias or path instead.
File ref is a nice option to have because it is the value returned from the
open for access command and as such gives you a definite link to the open
file which can be useful in complex scripts. It's also more geeky and less
intuitive and some scripters prefer that, but using path or alias is every
bit as reliable.
I also have a standard routine I use when opening files, that's similar to
the one David mentioned:
try
open for access myFileAlias with write permission
set fileRef to the result
on error
close access myFileAlias
open for access myFileAlias with write permission
set fileRef to the result
end try
ES
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.