Re: Unicode in AppleScript
Re: Unicode in AppleScript
- Subject: Re: Unicode in AppleScript
- From: glenn andreas <email@hidden>
- Date: Wed, 17 Aug 2005 09:56:11 -0500
On Aug 17, 2005, at 8:42 AM, Jerry Brace wrote:
On Wednesday, August 17, 2005, at 11:12AM, ObjM2
<email@hidden> wrote:
To eliminate any possible encoding problems with the NSString I've
just taken the AppleScript out temporally to get it working on it's
own first.
Once I see how to use the unicode characters in this basic script
I'll be able to adjust my code to generate the NSString properly.
tell application "iTunes"
play playlist "?????"
end tell
NOTE: "??????" is suppose to be the special Unicode characters -
they were removed when I sent the email. An example of a special
unicode character would be a star from the Character Palette Stars/
Asterisks category. Those are the types of characters I need to be
able to support.
When I try to enter such a script in "Script Editor", the instant
that I hit "compile" all those unicode characters dragged from the
Character Palette get converted to seemingly random other characters
(I'm sure there is some sort of pattern there, but it's none
obvious). Some characters even become multiple characters, but in
the end, as near as I can tell, the resulting characters are all
characters which can be encoding using MacRoman (and characters which
can be encoded with MacRoman are kept intact).
So it appears (even though there is an AppleScript unicode text
class) that when AppleScript scripts are compiled, it only supports
MacRoman-encodable text.
However, if you made an AppleScript subroutine, and called that from
Cocoa using your chock-full-of-unicode string as a parameter. Note
that there is no built in way to do this from Cocoa - you've
basically got to build up an AppleEvent to call that subroutine and
then call it via [script executeAppleEvent: event error: &error].
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
Widgetarium | the quickest path to widgets
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden