• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Labels of a Record
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Labels of a Record (From: email@hidden)

  • Prev by Date: Re: Misc Eudora questions
  • Next by Date: About iso.8601 in AppleScript
  • Previous by thread: Labels of a Record
  • Next by thread: Re: Labels of a Record
  • Index(es):
    • Date
    • Thread