Re: [applescript] TextEdit won't open a plain text file after writing to it with write cmd
Re: [applescript] TextEdit won't open a plain text file after writing to it with write cmd
- Subject: Re: [applescript] TextEdit won't open a plain text file after writing to it with write cmd
- From: Shane Stanley <email@hidden>
- Date: Sat, 16 Jun 2018 09:25:35 +1000
On 16 Jun 2018, at 4:30 am, Ilya Shebalin <email@hidden> 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
to:
write theText to FileID as «class utf8»
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden