Applescript: Cannot save changes after edit a file in TextEdit
Hello,
I need next task: open existing file, type some text in this document, save and close.
I written next script:
set theText to "I want to paste this text into existing document"
set theFile to (path to desktop as string) & "autotest:word.rtf"
tell application "TextEdit"
activate
opentheFile
makenewparagraphat end of front documentwith datatheText
closetheFilesavingyes
end tell
Looks like it works. But when I reopen this document manualy - there are no changes.
Please tell me what i do wrong,
Thanks!
Mac mini, OS X Mavericks (10.9)