This gives no problem when "d:\foo.txt" is empty. But when foo.txt is not empty yet: how to script that file emptyopen file "d:\foo.txt"
write tResult to file "d:\foo.txt"

Why I have to wait 5 seconds at least, when clicking edit script

Is there no other way to edit a script?
In my previous programmer live you could rightclick a button for that

Rob