• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [applescript] TextEdit won't open a plain text file after writing to it with write cmd
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: [applescript] TextEdit won't open a plain text file after writing to it with write cmd
      • From: Alastair Leith <email@hidden>
References: 
 >TextEdit won't open a plain text file after writing to it with write cmd (From: ILJA SHEBALIN <email@hidden>)

  • Prev by Date: TextEdit won't open a plain text file after writing to it with write cmd
  • Next by Date: Re: iTunes Playlist
  • Previous by thread: TextEdit won't open a plain text file after writing to it with write cmd
  • Next by thread: Re: [applescript] TextEdit won't open a plain text file after writing to it with write cmd
  • Index(es):
    • Date
    • Thread