The problem, of course, is defining the range. By experiment, I found that a range is defined as a string containing two cells separated by a colon, e.g.:
tell application "Numbers"
tell document 1
tell sheet 1
tell table 1
range 1
end tell
end tell
end tell
end tell
--> {format:automatic, font name:"HelveticaNeue", alignment:center, font size:10.0, name:"A1:A1", class:range, text color:{0, 0, 0}, background color:{59111, 59111, 59111}, vertical alignment:top, text wrap:true}
Note that the range's name is "A1:A1".
This leads me to believe that the following script should work for a table containing rows 2 through 13:
tell application "Numbers"
tell document 1
tell sheet 1
tell table 1
sort by column 2 direction descending in rows "2:13"
end tell
end tell
end tell
end tell
Unfortunately, it doesn't.
--> "Numbers got an error: Bad sort range."
The dictionary never describes the syntax of a range; maybe someone from Apple can address that problem here.
-- Michelle
--
Life is not a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside, thoroughly used up, totally worn out, and loudly proclaiming, "WOW! What a ride!!!"