Quite simply, I want to add text to an existing file:
set thePath to (path to desktop as Unicode text) & "somefile.txt"
set fRef to open for access file thePath with write permission
set FileContentsRaw to (read file thePath) as text
write "bob" & return to fRef
close access fRef
I’m forever getting:
Yes, I could do this easily in bash but I’d like to do it properly…
read file . calls open for access implicitly.
If you want to do read/write operations in the same file you have to read using the file descriptor (fRef)