Convert Unicode text into a string

Discussion in 'Mac Programming' started by semaja2, May 22, 2006.

  1. macrumors 6502a

    Joined:
    Dec 12, 2005
    Location:
    Adelaide
    #1
    Hey guys, how do I convert Unicode text into a string for use with AppleScript, like I set a variable to some Unicode text but how do I convert it back into a string?

    I tried looking in the Apple documentation but couldn't find a function that would work for me everytime i use the one in the documentation i get this error:

    [Session started at 2006-05-20 13:52:29 +0930.]
    2006-05-20 13:52:33.701 MultiAlarm[5483] "Error -1700: Can't make end of every «class defE» into type «class insl»."

    Cant make <<data ****0523453154354554H35RE4H35TS4H354354>> into type Unicode text. (-1700)


    the terminal reveals this for my prefrence file

    starbuck:~ jamesas$ defaults read com.semaja2.MultiAlarm
    {
    alarmSensitivity = <040b7479 70656473 74726561 6d8103e8 84014084 8484084e 534e756d 62657200 8484074e 5356616c 75650084 84084e53 4f626a65 63740085 84012a84 84016497 0686>;
    motionEngine = <040b7479 70656473 74726561 6d8103e8 84014084 8484084e 53537472 696e6701 8484084e 534f626a 65637400 8584012b 09706f77 6572626f 6f6b86>;
    }
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    I think defaults understands UniCode. That looks more like encoded data via something like an NSArchiver.
     
  3. thread starter macrumors 6502a

    Joined:
    Dec 12, 2005
    Location:
    Adelaide
    #3

    ahh thats it, all this time and it was a simple option i ticked in bindings, thanks for pointing it out i was ripping my hair out over this
     

Share This Page