What you describe may be done easily with this kind of script :
--
set document_source to "Document1.numbers"
set feuille_source to "Feuille 1"
set table_source to "Tableau 1"
set colonne_source to 5
set ligne_source to 3
set document_destination to "Document2.numbers"
set feuille_destination to "Feuille 2"
set table_destination to "Tableau 5"
set colonne_destination to 6
set ligne_destination to 5
set nbr to 10 -- number of cells to copy/paste
tell application "Numbers"
tell document document_source to tell sheet feuille_source to tell table table_source
set les_valeurs to value of cells ligne_source thru (ligne_source + nbr - 1) of column colonne_source
end tell -- document…
tell document document_destination to tell sheet feuille_destination to tell table table_destination
tell column colonne_destination
repeat with r from 1 to nbr
set value of cell (ligne_destination + r - 1) to item r of les_valeurs
end repeat
end tell -- column
end tell -- document…
end tell -- Numbers
--
In this bare draft, I make no check upon the availability of two opened numbers documents named document_sources and document_destination.
I make no check upon the availability of table table_source sheet feuille_source of document document_source.
I make no check upon the availability of table table_destination sheet feuille_destination of document document_destination.
I make no check upon the existence of nbr cells starting from row ligne_source in column colonne_source.
I make no check upon the existence of nbr cells starting from row ligne_destination in column colonne_destination.
I don't take care of possible blank cells in the source range.
If some of them exist, the destination cell will not be blank but will contain 0.0.
You may use this kind of script.
I just dislike such ones.
The unique advantage of such scripts (I already posted some of them but it seems that you missed them), is that they doesn't require that the source table and/or the target one are visible.
In most of the scripts which I post, the parameters describing the manipulated objects are extracted on the fly. The values are not "set" but transferred thru Copy then Paste Applying Style.
Doing that, a blank cell remains a blank cell.
The counterpart is that I must use GUI Scripting and use a bit complicated pieces of code to make the manipulated objects visibles because GUI scripting requires that.
You are free to use the scheme which you want.
I feel free to write the kind of scripts which I feel better.
Search in the area "Numbers '09" in the range "All" with the keystring "script AND koenig" and you will find several scripts working on two documents. I wrote koenig, not yvan because this way you will not get links to thread in which my scripts are simply named by a helper.
In the returned scripts, you will find some embedded pieces of code checking what I didn't check in the one passed today. In some, datas are passed with "get value" and "set value" as I did here. In most of them, they are passed with Copy / Paste.
From my point of view, the best script is the one which match the needs of the user.
When I worked as a potter I made only what I decided to do, never taking care of customers requirements.
When I build a script, I try to give an efficient response to the askers problem, but I feel free to apply my own choices. As the scripts which I post are signed with my true name, not with a pseudo, I have to preserve my dignity. I'm fond of well done job.
Yvan KOENIG (VALLAURIS, France) mercredi 13 octobre 2010 21:46:03
You will find in them the pieces of code required by the checks which I didn't coded here.