• 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: Unicode in AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Unicode in AppleScript (From: Jerry Brace <email@hidden>)
 >Re: Unicode in AppleScript (From: ObjM2 <email@hidden>)
 >Re: Unicode in AppleScript (From: Jerry Brace <email@hidden>)

  • Prev by Date: [NSColor clearColor] and NSBezierPath: not compatible?
  • Next by Date: Re: Communicating between applications
  • Previous by thread: Re: Unicode in AppleScript
  • Next by thread: Re: Unicode in AppleScript
  • Index(es):
    • Date
    • Thread