G’day Shane.
Once again, put your ‘I'm bloody smart’ cap on.
Worked brilliantly, with an alteration. I need to save attachments into it.
Thank you, thank you!!
Regards, and Merry Christmas to everyone, from someone who can actually legitimately call himself ‘Father Christmas’ (two kids, 6 grandies)
Brian Christmas
set pathToFile to (path to desktop as text) & "test" & ".rtfd" -- create file set theFile to pathToFile as «class furl» set fileRef to open for access theFile with write permission close access fileRef tell application "TextEdit" tell document 1 save in theFile end tell end tell
On 22 Dec 2016, at 9:27 am, Shane Stanley < email@hidden> wrote:
It appears that TextEdit won't let you write to a file that doesn't already exist. A workaround is to create the file first:
set pathToFile to (path to desktop as text) & "test" & ".rtf" -- create file set theFile to pathToFile as «class furl» set fileRef to open for access theFile with write permission close access fileRef tell application "TextEdit" tell document 1 save in theFile end tell end tell
|