Re: Labels of a Record
Re: Labels of a Record
- Subject: Re: Labels of a Record
- From: Mr Tea <email@hidden>
- Date: Tue, 06 Aug 2002 03:06:47 +0100
This from email@hidden - dated 6-8-02 12.29 am:
>
If you do:
>
{a: "b", c:3, d:"Jojo Bozo"} as list
>
>
you get:
>
{"b", 3, "Jojo Bozo"}
>
>
is there any way to get:
>
{a, c, d}
>
?
>
>
What I want, really, is a list of the labels,
Well, you could take a hammer to it...
set theTestList to {a:"b", c:3, d:"Jojo Bozo"}
try
theTestList as string
on error errmsg
set AppleScript's text item delimiters to ":"
set theChunks to every text item of errmsg
set AppleScript's text item delimiters to ""
set theLabelList to {}
repeat with theText in items 1 thru -2 of theChunks
set theLabelList to theLabelList & {character -1 of theText, ", "}
end repeat
end try
items 1 thru -2 of theLabelList as string
--> "a, c, d"
It's as rough as a bear's behind, but perhaps you can use it. ;-)
Nick
_______________________________________________
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.