• 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: Sorting characters of the text - script doesn't work as expected
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sorting characters of the text - script doesn't work as expected


  • Subject: Re: Sorting characters of the text - script doesn't work as expected
  • From: Yvan KOENIG <email@hidden>
  • Date: Fri, 26 May 2017 17:21:48 +0200

As I am pig headed, I continued to fight with the 4th file, the one named  "Отчет.txt".

I opened it by hand then ran this short script :

tell application "TextEdit"
activate
text of document 1
end tell

It worked.

I tried with :

tell application "TextEdit"
activate
set MyDoc to text of document 1
end tell
This one froze.

I looked in Hexedit and saw that the file starts with FFFE which is the UTF16 Low Endian BOM.
Just after the BOM I saw : FC FF FC FF FC FF FC FF FC FF FC FF FC FF FC FF
which seems to be odd.
In TextEdit, I inserted the string "abcd" at the very beg and saved.
Fine, after that the BOM is here but the 16 extraneous bytes are gone.
In TextEdit I deleted "abcd" and saved again.
After that the file seemed to be clean but the second script continued to freeze.

I opened the original in Pages then exported as text.
I got a file encoded in Utf8 with no BOM.

Both scripts behave well upon this late file.

ILJA SHEBALIN  seems to be unable to explain that and worse he seems to be unable to understand the description of what is striking.

With a bit of luck one of you will be able to try to reproduce what I did and report what he got.

On my side I will apply the "cleaning" process to the three other docs so that, with a bit of luck, I will be able to run the main script.


Yvan KOENIG running Sierra 10.12.5 in French (VALLAURIS, France) vendredi 26 mai 2017 17:21:43



 _______________________________________________
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: Sorting characters of the text - script doesn't work as expected
      • From: Yvan KOENIG <email@hidden>
References: 
 >Re: Sorting characters of the text - script doesn't work as expected (From: ILJA SHEBALIN <email@hidden>)
 >Re: Sorting characters of the text - script doesn't work as expected (From: ILJA SHEBALIN <email@hidden>)
 >Re: Sorting characters of the text - script doesn't work as expected (From: ILJA SHEBALIN <email@hidden>)
 >Re: Sorting characters of the text - script doesn't work as expected (From: ILJA SHEBALIN <email@hidden>)

  • Prev by Date: Re: Sorting characters of the text - script doesn't work as expected
  • Next by Date: Re: Sorting characters of the text - script doesn't work as expected
  • Previous by thread: Re: Sorting characters of the text - script doesn't work as expected
  • Next by thread: Re: Sorting characters of the text - script doesn't work as expected
  • Index(es):
    • Date
    • Thread