Re: writing data to a file
Re: writing data to a file
- Subject: Re: writing data to a file
- From: Stephen Swift <email@hidden>
- Date: Tue, 30 Apr 2002 16:54:05 -0400
- Secret-message: Congratulations! Send me a message with this header asthe subject to receive your prize!
At 4/30/02 12:02 PM, Kinsella, John R. (email@hidden) Wrote:
>
My roadblock is that I can't seem to
>
figure out how to access and write to a file more than once. I can create a
>
new txt file and add data to it once, but after that, I'm informed that
>
there is a duplicate file and the script errors out.
Hmm... Are you clossing access to the file? You must do that before you
open it again or it will give you an error.
Like so:
set selected_file to choose file
set fileref to open for access selected_file with write permission
write "text 1" & return to fileref
close access fileref
--Important Step!
set fileref to open for access selected_file with write permission
write "text 2" & return to fileref starting at eof
close access fileref
Stephen Swift
email@hidden
-----------------------------------------------
AppleScript Guru - The Mac Observer
http://www.macobserver.com/tips/applescript
_______________________________________________
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.