The table class can be the target of the transpose command, which takes as its direct parameter, the table whose rows and columns are to be transposed.
transposev : Transpose the rows and columns of the table.
transposetable
Transpose Selected Table
01
tellapplication "Numbers"
02
activate
03
try
04
if not (existsdocument 1) then errornumber 1000
05
telldocument 1
06
try
07
tellactive sheet
08
set theselectedTableto ¬
09
(the firsttablewhoseclassofselection rangeisrange)
10
end tell
11
on error
12
errornumber 1001
13
end try
14
transposeselectedTable
15
end tell
16
on errorerrorMessagenumbererrorNumber
17
iferrorNumberis 1000 then
18
setalertStringto "MISSING RESOURCE"
19
seterrorMessageto ¬
20
"Please create or open a document before running this script."
21
else iferrorNumberis 1001 then
22
setalertStringto "SELECTION ERROR"
23
seterrorMessageto "Please select a table before running this script."
Mention of third-party websites and products is for informational purposes only and constitutes neither an endorsement nor a recommendation. MACOSXAUTOMATION.COM assumes no responsibility with regard to the selection, performance or use of information or products found at third-party websites. MACOSXAUTOMATION.COM provides this only as a convenience to our users. MACOSXAUTOMATION.COM has not tested the information found on these sites and makes no representations regarding its accuracy or reliability. There are risks inherent in the use of any information or products found on the Internet, and MACOSXAUTOMATION.COM assumes no responsibility in this regard. Please understand that a third-party site is independent from MACOSXAUTOMATION.COM and that MACOSXAUTOMATION.COM has no control over the content on that website. Please contact the vendor for additional information.