------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2017/04/24 01:09
# dMod: 2017/04/24 01:46
# Appl: TextEdit, Finder
# Task: Create a new TextEdit document and save it on the Desktop
# : Works around a very nasty bug in macOS.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Finder, @TextEdit, @ccstone, @Save, @Bug, @WorkAround
------------------------------------------------------------------------------
set destPath to (path to desktop folder as text) & "test_doc.rtf"
set someText to "Now is the time for all good men to come to the aid of their country."
close access (open for access destPath)
tell application "TextEdit"
activate
make new document with properties {text:someText}
tell front document
save in file destPath
end tell
end tell
tell application "Finder"
reveal destPath as alias
end tell
------------------------------------------------------------------------------
You pointed out the basics of this to someone last month.