Re: Coerce string to record or something like that?
Re: Coerce string to record or something like that?
- Subject: Re: Coerce string to record or something like that?
- From: Emmanuel <email@hidden>
- Date: Wed, 12 Dec 2001 08:53:23 +0100
At 4:34 +0100 12/12/01, Michael wrote:
>
Is there a
>
way to easily convert a string like "[status: /"unproc/",lyrics: false]" or
>
"status: "unproc",lyrics: false" into a record?
If you set the name to :
"status","unproc","lyrics",false
then storing the name into "theName", then running:
--------------------------
set theRec to run script "{+class usrf;:{" & theName & "}}"
--------------------------
returns:
-- {status:"unproc", lyrics:false}
HTH
Emmanuel
PS
Also interesting as a name
"status","unproc",<<class pnam>>,"Tom"
PPS
Do not write "name" ... in the name! AppleScript might attempt to get its
own name, something which has crashed at least some versions.