• 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: Open files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Open files
      • From: Dave Balderstone <email@hidden>
  • Prev by Date: Re: theSIMS -- Applescript copy paste from Explorer
  • Next by Date: Re: Open files
  • Previous by thread: Re: Open files
  • Next by thread: Re: Open files
  • Index(es):
    • Date
    • Thread