Re: Close access file question ...
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.