<pre>-- This version will over-write existing file.on writeFile content,filePath  open file filePath  write content to file filePath  close file filePathend writeFile-- This version will not over-write existing file.on writeFile content,filePath  if there is a file filePath then    put readFile(filePath) into prevContent    open file filePath    write prevContent & content to file filePath  else    open file filePath    write content to file filePath  end if  close file filePathend writeFile-- This is a more secure version.on writeFile content,filePath  set the itemDelimiter to colon  get filePath  delete last item of it  if there is not a folder it then return "Incorrect path"  if there is a file filePath then    put readFile(filePath) into prevContent    open file filePath    write prevContent & content to file filePath  else    open file filePath    write content to file filePath  end if  if the result is not empty then then return "Problem writing file"  close file filePathend writeFile</pre>