• 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: Adrian Milliner <email@hidden>
  • Date: Thu, 21 Oct 2004 07:42:20 +0100

Remember that the applescript 'host', whether Script Editor or ASS, has the file open and not the script itself.

If you run a script that opens a file and then stops before closing it again, you will not be able to delete the file until you close it or quit the applescript 'host'.

You are seeing the latter by logging out, but you shouldn't have to go that far.

Remember, with applescript, it's always a good idea to restart ASS/Script Editor from time to time to flush out all the work you've been doing.


On 21 Oct 2004, at 02:16, Malcolm Fitzgerald wrote:

On Oct 20, 2004, at 4:34 PM, Michelle Steiner wrote:

set new_file to choose file name default name "log.txt" default location (path to documents folder)
set fref to open for access new_file with write permission
write my_data to fref
close access fref

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. ... Each time, I got an error message "File file
...Documents:log.txt is already open.".
Is this normal? Seems like a bug to me.

Not a bug. It usually only happens during testing.

The error happens when a file is opened and not closed afterwards. You can open the file many times if you don't close it just as many times the system will complain.

-- Malcolm Fitzgerald phone: 02 9318 0877
Database Manager fax: 02 9318 0530
The Australian Society of Authors <http://www.asauthors.org>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden


_______________________________________________ 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>)
 >Re: Creating a log file. (From: Malcolm Fitzgerald <email@hidden>)

  • Prev by Date: Re: Script to Cycle Through Apps?
  • Next by Date: Re: Set Volume / Get Volume ?
  • Previous by thread: Re: Creating a log file.
  • Next by thread: Re: Creating a log file.
  • Index(es):
    • Date
    • Thread