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: Alastair Leith <email@hidden>
- Date: Sat, 16 Jun 2018 12:23:11 +0800
I find that this won’t save the document. I have to do a save as, then macOS
asks if I want .rtf or .txt as per the default file name. So it seems to think
it’s a RTF file, but in fact all the text formatting has been lost. Is it
possible to maintain the rich text formatting in the text file same as email?
Also the top of the script seems to be iterating through multiple messages with
the rest of the script just operating on the last message in the selection.
> On 16 Jun 2018, at 7:25 am, Shane Stanley <email@hidden> wrote:
>
> 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
_______________________________________________
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