PDA

View Full Version : Sorting Arrays in AppleScript / Losing Classic OSAX




Mackey
Jul 7, 2006, 08:59 AM
Now that I’ve had to abandon some beloved classic OSAX, I’m searching for new answers. Does anyone know if there is an easy way to sort arrays of lists in AppleScript or via an OSAX? For example, I would like to be able to sort this array by either the text value or the number value:
{{“Dinner Music”, 27}, {“Bedtime Music”, 38}, {“Party Music”, 47}}

Some of the old OSAX would also let you do things like turn that array into
{“Dinner Music”, “Bedtime Music”, “Party Music”}
or
{27, 38, 47}

Does anyone have recommendations for OSAX that perform similar operations?
Thanks,



slooksterPSV
Jul 8, 2006, 08:20 AM
I don't know much about AppleScript, but I did find this example in the AppleScript Studio. Here it is, it actually is part of an XCode example, but part of that program is actually an AppleScript. Here is the code in AppleScript. Doesn't mean anything to me, but maybe it does to you.

make new data column at end of data columns of theDataSource with properties {name:"city", sort order:ascending, sort type:alphabetical, sort case sensitivity:case sensitive}