Re: Creating a log file.
Re: Creating a log file.
- Subject: Re: Creating a log file.
- From: Dave Balderstone <email@hidden>
- Date: Wed, 20 Oct 2004 16:09:55 -0600
On Oct 20, 2004, at 3:51 PM, Michael McGonagle wrote:
Hum, I tried to run this, and each subsequent time that I ran this,
keeping the same name for the log file (ie replacing it), AppleScript
would not do it. Even when I would manually delete that file from the
Documents folder, AppleScript still asked about replacing the file. I
even went so far as to run it again after having put the file in the
trash and emptying the trash, but AppleScript still asked if I wanted
to replace the file. Each time, I got an error message "File file
...Documents:log.txt is already open.".
On Oct 20, 2004, at 3:58 PM, Michael McGonagle wrote:
Wow, this is even more weird than I thought, I can't even delete the
file that was created. The log.txt file says that it is in use and
will not delete...
Are you executing the code in a Finder "tell" block? You shouldn't be.
Is your script editor still running? Try quitting it. If that doesn't
work and you ran the code in a Finder tell, you may have to quit the
Finder.
When I open a file for access, I always add the following:
set new_file to choose file name default name "log.txt" default
location (path to documents folder)
try
close access new_file
end try
...
djb
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden