Re: interesting discovery (trying to get record labels as strings)
Re: interesting discovery (trying to get record labels as strings)
- Subject: Re: interesting discovery (trying to get record labels as strings)
- From: "Neal A. Crocker" <email@hidden>
- Date: Sun, 2 Dec 2001 22:54:37 -0800
Message: 11
Date: Sun, 2 Dec 2001 17:07:27 -0500
From: Victor Yee <email@hidden>
Subject: Re: interesting discovery (trying to get record labels as
strings)
To: applescript-users <email@hidden>
On Sun, 2 Dec 2001 13:13:06 -0700, Michelle Steiner wrote,
Even more interestingly: {{hello:"goodbye"}} as string
--> "usrflist&TEXThelloTEXTgoodbye"
Try this:
property k0 : ASCII character 0
property k1 : ASCII character 1
property k000 : k0 & k0 & k0
property k0000 : k000 & k0
property k0001 : k000 & k1
property kUSRFheader : k0001 & k0000 & "usrflist"
property kTEXT : "TEXT"
set a to {"hello", "goodbye"}
set itemCnt to k000 & (ASCII character (count of a))
set keyLen to length of a's item 1
set valLen to length of a's item 2
set keyCode to kTEXT & k000 & (ASCII character keyLen)
set valCode to kTEXT & k000 & (ASCII character valLen)
set recCode to itemCnt & k0000 & keyCode & a's item 1 & k0 & valCode
& a's item
2 & k0
set charCnt to k000 & (ASCII character (count of recCode))
set x to kUSRFheader & charCnt & recCode
x as record
Victor
--__--__--
you can shorten that to:
{{+class usrf;:{"hello", "goodbye"}}} as string as record
-- returns: {hello:"goodbye"}
Neal