Re: Unicode to plain text
Re: Unicode to plain text
- Subject: Re: Unicode to plain text
- From: John Delacour <email@hidden>
- Date: Thu, 19 Sep 2002 23:05:18 +0100
At 3:14 pm -0700 18/9/02, Jon Pugh wrote:
At 12:02 PM -0700 9/18/02, Jon Pugh wrote:
Does anyone know how to convert utxt to TEXT in plain AppleScript?
And the winner is:
At 2:04 PM -0700 9/18/02, John Coelho wrote:
>set plain_text to +class ktxt; of (unicodeString as record)
Unless, of course, it is _true_ Unicode text, in which case it will
not be coerced to a record, since it needs to contain no style info.
The style info is purely for the purposes of displaying in
NON-Unicode fonts in NON-Unicode environments.
One day the message is going to get through!
Try this:
set f to "" & (path to temporary items) & "junk.txt"
open for access file f with write permission
set eof file f to 0
repeat with i in words of "254 255 14 161 14 162 14 163"
write (ASCII character i) to file f
end repeat
close access file f
tell application "TextEdit"
open {alias f}
set uText to get paragraph 1 of document 1
end tell
class of uText --> Unicode text
try
uText as record
on error e
return {uText, e}
end try
-- JD
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.