• 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: Close access file question ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Close access file question ...


  • Subject: Re: Close access file question ...
  • From: John Delacour <email@hidden>
  • Date: Tue, 13 Aug 2002 00:47:02 +0100

At 3:35 pm -0700 12/8/02, Charles Heizer wrote:

Here is my problem then. I'm developing a couple of scripts that error out
while a file is open for access. Once they are open for access I can't do
anything with them until I reboot. Is there a way around this?

This is a very frequent occurrence when your building a script. The best way is to develop a habit of starting off with a try block. You will find it'll save you a lot of bother.


set f to "" & (path to current user folder) & "Documents:abg.txt"
try
close access file f
on error e
end try
open for access file f with write permission
-- do stuff
close access file f

JD
_______________________________________________
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.

References: 
 >Re: Close access file question ... (From: Charles Heizer <email@hidden>)

  • Prev by Date: Re: 1.8.3 ???
  • Next by Date: Re: making a script wait until a task finishes before proceeding
  • Previous by thread: Re: Close access file question ...
  • Next by thread: Re: Close access file question ...
  • Index(es):
    • Date
    • Thread