You use this to sort a list of lists. in this form it’s a parallel sort: the command sorts the list at the given ‘with respect to’ index and rearranges the other lists in exactly the same way. examples:
set l1 to {{"r", "q", "f", "c"}, {"a", "n", "z", "b"}, {"t", "a", "l", "q"}, {"p", "p", "z", "l"}}
sortlist l1
— sorts list 1 (by default) and rearranges the remaining lists in parallel
--{{"c", "f", "q", "r"}, {"a", "b", "n", "z"}, {"a", "l", "q", "t"}, {"l", "p", "p", "z"}}
sortlist l1 with respect to 2
— sorts list 2 and sorts the remaining lists in parallel
--{{"r", "c", "q", "f"}, {"a", "b", "n", "z"}, {"t", "q", "a", "l"}, {"p", "l", "p", "z"}}
sortlist l1 with respect to {4, 3} without ascending
— sorts list 4 (descending) first (and the other lists in parallel) then resorts items 2 and 3 (where list 4 has matching P’s) by the descending sort order of those items in list 3
--{{"f", "r", "q", "c"}, {"z", "a", "n", "b"}, {"l", "t", "a", "q"}, {"z", "p", "p", "l"}}
sortlist l1 with respect to {4, 3} ascending {true, false}
— same as above except the initial sort is descending and the sub-sort is ascending.
--{{"c", "r", "q", "f"}, {"b", "a", "n", "z"}, {"q", "t", "a", "l"}, {"l", "p", "p", "z"}}
Hope that helps...