try
set theFile to (((path to desktop) as text) & "OUTPUT:" & "test.txt") as alias
set N to open for access theFile with write permission
get eof N
if result > 0 then
set theText to read N
set eof N to 0
write "This is line 2" & return & theText to N
end if
close access N
end try
Reference:
Applescript: to open a file, add a line of text at the top, and then close the file.
https://discussions.apple.com/message/18858350#18858350
No comments:
Post a Comment