Re: Searching for the equivalent of coercing to type "record"
Re: Searching for the equivalent of coercing to type "record"
- Subject: Re: Searching for the equivalent of coercing to type "record"
- From: John W Baxter <email@hidden>
- Date: Sat, 8 Mar 2003 22:14:55 -0800
- Envelope-to: email@hidden
Emmanuel was quoted as saying:
>
>----------------------------
>
>run script ("{<<class usrf>>:{\"a\", \"b\"}} as record")
>
> --> {a:"b"}
>
>----------------------------
>
>----------------------------
>
>run script ("{<<class usrf>>:{\"a\", \"b\"}} as record")
>
> --> {a:"b"}
>
>----------------------------
Note that you will have slight oddities if the names ("a" above) happen to
collide with known terminology words:
set a to run script ("{+class usrf;:{\"application\", \"beer\"}} as record")
{
|application|:"beer"
}
but at least the item is still inside the user fields item:
Script Debugger's AE Print display:
{
usrf:[
"application",
"beer"
]
}
And, somewhat to my surprise, here's a case where app isn't expanded to
application but is recognized:
set a to run script ("{+class usrf;:{\"app\", \"beer\"}} as record")
{
|app|:"beer"
}
This phenomenon may or may not get in the way of the desired use of the
converted data.
I think I'd prefer to use one of the hash table solutions.
--John
--
John Baxter email@hidden Port Ludlow, WA, USA
Is beer an application?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.