Applescript Copying a table between documents
Hi All,
SG was so kind to help out with a script that opened 2 documents and copied/pasted a table from one to the other document.
I wanted to modify the script to work with both documents already opened.
I have modified (possibly broken) SGs script to this:
tell application "System Events"
tell process "Numbers"
set frontmost to true
-- Selects Document1
click (first menu item whose name contains "Document1") of menu "Window" of menu bar 1
end tell
end tell
tell application "Numbers"
set t to table 1 of sheet 1 of front document -- selects the table
tell application "Numbers" to activate
delay 0.4
tell application "System Events" to keystroke "c" using {command down}
end tell
tell application "System Events"
tell process "Numbers"
set frontmost to true
-- Selects Document2
click (first menu item whose name contains "Document2") of menu "Window" of menu bar 1
end tell
end tell
tell application "Numbers"
tell application "Numbers" to activate
delay 0.4
tell application "System Events" to keystroke "v" using {command down}
end tell
Its seems to work, but it does not paste the copied table, but this:
What am I doing wrong here?
Best...Jan