I have a Numbers document that I want to activate, make a selection, copy they activate a second window and paste it in, using AppleScript.
I can bring the document to the front and make the selection, but not copy the selection. This can only be done when the document is active, ie “clicked” on. How do I make it active or in other words, “clicked” on? it should be simple!
Here is the base code that does what I want up to copying the cells.
Any help would be greatly appreciated.
tell application “Numbers”
set myWindow to name of document “Untitled”
set index of window myWindow to 1
tell table 1 of sheet 1 of document myWindow
set thisRange to “A2:D15”
set the selection range to range thisRange
–Get Modified probabilities and copy to clipboard
tell application “System Events” to tell process “Numbers”
tell menu bar item “Edit” of menu bar 1
click menu item “Copy” of menu 1
click menu item “Delete” of menu 1