• 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
Sort value pairs in a list by integer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sort value pairs in a list by integer


  • Subject: Sort value pairs in a list by integer
  • From: Joseph Weaks <email@hidden>
  • Date: Tue, 1 Jul 2003 04:21:05 -0500

I can't get my head around this. I have a list that might contain between 5 to 10 pairs of values:

set foobar to {"foo", 15, "bar", 6, "boo", 2, "far", 19}

The numbers "go with" the preceding string and I want to return a list sorted in descending order by the integer value. ie. the result should be

sortIt(foobar)
-- {"far", 19, "foo", 15, "bar", 6, "boo", 2}

Any help is appreciated.
Thanks,
Joe Weaks
_______________________________________________
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.

  • Follow-Ups:
    • Re: Sort value pairs in a list by integer
      • From: Emmanuel <email@hidden>
    • Re: Sort value pairs in a list by integer
      • From: Deivy Petrescu <email@hidden>
  • Prev by Date: Entourage scripts works on *some* computers
  • Next by Date: Re: apple
  • Previous by thread: Re: Entourage scripts works on *some* computers
  • Next by thread: Re: Sort value pairs in a list by integer
  • Index(es):
    • Date
    • Thread