I have written a simple script to update a column in numbers, which in turn updates a chart. What I would like to do next is select that chart so that I can copy it to clipboard.
One method I found is to tell system events to tab to that chart, but that could be problematic if the user clicks on something unexpected before running the script.
In Numbers 6.1, I find I can select an entire chart just by asking for its properties! Numbers changes the focus to it in its GUI. Similarly with tables.
tell application "Numbers"
activate
tell document 1
get properties of chart 1 of sheet 1
end tell
end tell
Not with the document I tested and have just retested. If the required chart or table isn’t already selected, I have to ask for its properties in order to get the focus to change to it. This works even if the chart or table’s in a different sheet from the current focus. Presumably the behaviour’s entirely incidental and may be connected with some preference setting.