Good news
I don't know the behavior on all versions of OS X but I describe the French one.
In Numbers 2.x, starting from a document whose cell B2 of table 1 of sheet 1 contain my birthday : 31/12/1943 23:59:59 this simple script fails.
tell application "Numbers" to tell document 1 to tell sheet 1 to tell table 1
set myBirthday to value of cell "B2"
log (get class of myBirthday)
set value of cell "C3" to myBirthday
end tell
with the error : error "Erreur dans Numbers : Le gestionnaire AppleEvent a échoué." number -10000
To get it working it was required to coerce the date into text :
tell application "Numbers" to tell document 1 to tell sheet 1 to tell table 1
set myBirthday to value of cell "B2"
log (get class of myBirthday)
set value of cell "C3" to myBirthday as text
end tell
Alas, it was not satisfying because when the date is extracted it's wrong as we may check in the log report :
tell application "Numbers"
get value of cell "B2" of table 1 of sheet 1 of document 1
--> date "samedi 1 janvier 1944 00:59:59"
(*date*)
set value of cell "C3" of table 1 of sheet 1 of document 1 to "samedi 1 janvier 1944 00:59:59"
end tell
Of course everybody understood : the date is passed with the UTC offset. It would be worse if the script was used in August due to the Summer Hour. The offset would be 2 hours.
So, when I installed Numbers 3.1 which at last give us AppleScript support (in fact quite the same than the one available in 2.x) I made a first test to see how the date is treated. I ran the first version :
tell application "Numbers" to tell document 1 to tell sheet 1 to tell table 1
set myBirthday to value of cell "B2"
log (get class of myBirthday)
set value of cell "C3" to myBirthday
end tell
Bingo, it works.
It's a bit surprising because the extracted date is embedding the UTC offset as it is in 2.x, the log report is surprising also :
tell application "Numbers"
get value of cell "B2" of table 1 of sheet 1 of document 1
--> date "samedi 1 janvier 1944 00:59:59"
(*date*)
set value of cell "C3" of table 1 of sheet 1 of document 1 to date "samedi 1 janvier 1944 00:59:59"
end tell
but the inserted date is the correct one.
So, in spite of the unability to rule correctly the sheet layout (we must activate the Print feature to see the pages boundaries) I will use this new version.
Yvan KOENIG (VALLAURIS, France) samedi 25 janvier 2014 11:18:18