delete __createfile
createfile until EOF
{concatenation "%0D%0A" of lines of file (pathname of system folder as string & "\drivers\etc\hosts")}
12.13.14.15 test.test.test.test1
EOF
delete {(pathname of system folder as string & "\drivers\etc\hosts")}
move __createfile {(pathname of system folder as string & "\drivers\etc\hosts")}
I’ve seen using move instead of copy do some odd things with permissions. It shouldn’t be an issue in this case, but something to keep in mind in others.
Sorry for the bump 2 years later, but I wanted to add this: