Re: Adding to a text file
Re: Adding to a text file
- Subject: Re: Adding to a text file
- From: Dave Balderstone <email@hidden>
- Date: Wed, 16 Mar 2005 13:48:12 -0600
On Mar 16, 2005, at 12:21 PM, Francois Houle wrote:
I'm just not sure how to do this, but is there a way with AS to add
text
to the beginning of a .txt file ? I want to append two lines of text
which I as variables to make it easier to type ... Just dobnw know how
to append this text to the beginning of a file, and on two consecutive
lines.
Francois:
set theDesktop to path to desktop as string
set theFile to theDesktop & "A_text_file.txt" as string
set ReadFile to read file theFile
set theText to "This is line 1" & return & "this is line 2" & return as
text
set WriteFile to theText & ReadFile
try
close access file ReadFile
end try
open for access file theFile with write permission
set eof file theFile to 0
write WriteFile to file theFile starting at eof
close access file theFile
_______________________________________________
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