Sorting Arrays in AppleScript / Losing Classic OSAX

Discussion in 'Mac Programming' started by Mackey, Jul 7, 2006.

  1. Mackey macrumors newbie

    Apr 26, 2006
    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”}
    {27, 38, 47}

    Does anyone have recommendations for OSAX that perform similar operations?
  2. slooksterPSV macrumors 68040


    Apr 17, 2004
    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}

Share This Page