Re: how to do a proper alphabetical sort?
Re: how to do a proper alphabetical sort?
- Subject: Re: how to do a proper alphabetical sort?
- From: "Mark J. Reed" <email@hidden>
- Date: Thu, 8 Mar 2007 19:36:43 -0500
On 3/8/07, Patrik B. <email@hidden> wrote:
Hi,
I am looking for a library or method that does an alphabetical sort?
I'm sure there's a way to do it with "pure" AS, but you can use the
shell command "sort" to do it:
set unsortedList to { "apple", "Arthur", "Carl", "Betty", "candy", "dog" }
set old_delims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {ASCII character 10}
set sortedList to paragraphs of (do shell script "echo " & quoted form
of (unsortedList as string) & "| sort -d -f")
That gives {"apple", "Arthur", "Betty", "candy", "Carl", "dog"} - not
exactly what you wanted since you specified uppercase before
lowercase, but perhaps good enough?
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden