Using AppleScript to manipulate Numbers to help organize youth wrestling tournaments:
The relevant portion of my script looks like this:
-- SELECT THE ROWS
tell document 1
tell active sheet
tell table 1
set WeightClassRows to ¬
((name of first cell of row "3") & ":" & (name of last cell of row EndWeightClass))
set the selection range to range WeightClassRows
end tell
end tell
end tell
So far, it works. Once I have certain rows selected, I need to copy the information and paste it elsewhere. This works:
-- COPY THE INFORMATION
tell application "System Events"
keystroke "c" using {command down}
end tell
...
-- PASTE THE INFORMATION SOMEWHERE ELSE
tell application "System Events"
keystroke "v" using {command down, option down, shift down}
end tell
But I would prefer to use the clipboard to copy the information rather than system events. However, I can't figure it out despite searching and trying a number of things, such as:
set the clipboard to WeightClassRows
set the clipboard to range WeightClassRows
set the clipboard to content of WeightClassRows
set the clipboard to content of selection range
But none of these (or similar things) work. Either it returns the cell reference ("B3:J9"), nothing at all, or returns an error saying something like "Can't get content of B3:J9"
Any ideas on how to use the clipboard rather than system events to copy the information once it is selected?
Thank you!