How do I erase contents of an existing file..

I am opening a file using the following command

set destfile to open for access “NewFolder:MyFile.txt” with write permission

how do I erase the full contents of this file before inputting new text into the file?

Something like the following:

set myFile to “NewFolder:MyFile.txt”
set destfile to open for access myFile with write permission
set eof myFile to 0 --that’s a zero

eof means “end of file”. If you set the end to a length of 0, you move the pointer back to the beginning and start fresh.
:wink:

Mark