Re: TextEdit won't open a plain text file after writing to it with write cmd

Shane Stanley

On 16 Jun 2018, at 4:30 am, Ilya Shebalin <> wrote:

IIf the file exists and all the statements beyond "else" clause are executed then TextEdit gives a warning of a wrong encoding ("The document "theFile.txt" could not be opened. Text encoding Unicode (UTF-8) isn’t applicable.") and refuses to open the file.
You need to save the file as UTF-8 -- at the moment you're saving it in MacRoman. Change this:

write theText to FileID

write theText to FileID as «class utf8»

Shane Stanley <>
<>, <>

Join to automatically receive all group messages.