• 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: Creating a log file.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Creating a log file. (From: Vic Piercy <email@hidden>)
 >Re: Creating a log file. (From: Michelle Steiner <email@hidden>)
 >Re: Creating a log file. (From: Michael McGonagle <email@hidden>)

  • Prev by Date: Re: Creating a log file.
  • Next by Date: Re: Of clip2gif, clipboard, and OS 10.3
  • Previous by thread: Re: Creating a log file.
  • Next by thread: Re: Creating a log file.
  • Index(es):
    • Date
    • Thread