time to GMT # as we are in Summer time, in France it will be 3600 * 2 aka 2 hours
log result (*7200*)
# Build a date according to the host settings in winter time
set theDate to "12/12/12"
set theDate to date theDate
set year of theDate to 2016
set month of theDate to 3
set day of theDate to 22
set theDate to short date string of theDate
log result (*22/03/2016*)
tell application "Numbers"
tell table 1 of sheet 1 of front document
set value of cell "A1" to theDate
set value of cell "B1" to "= " & quote & quote & "&A1"
get value of cell "A1"
log result (*date lundi 21 mars 2016 23:00:00*)
date string of (get value of cell "A1")
log result (*lundi 21 mars 2016*)
get formula of cell "B1"
log result (*= ""&A1*)
get value of cell "B1"
log result (*2016-03-22 00:00*)
tell me to set theDate to date theDate
log result (*date mardi 22 mars 2016 00:00:00*)
set value of cell "A2" to theDate
set value of cell "B2" to "= " & quote & quote & "&A2"
get value of cell "A2"
log result (*date mardi 22 mars 2016 00:00:00*)
date string of (get value of cell "A2")
log result (*mardi 22 mars 2016*)
get formula of cell "B2"
log result (*= ""&A2*)
get value of cell "B2"
log result (*2016-03-22 01:00*)
end tell
end tell
# Build a date according to the host settings in summer time
set theDate to "12/12/12"
set theDate to date theDate
set year of theDate to 2016
set month of theDate to 3
set day of theDate to 29
set theDate to short date string of theDate
log result
tell application "Numbers"
tell table 1 of sheet 1 of front document
set value of cell "A3" to theDate
set value of cell "B3" to "= " & quote & quote & "&A3"
get value of cell "A3"
log result (*date mardi 22 mars 2016 00:00:00*)
date string of (get value of cell "A3")
log result (*mardi 29 mars 2016*)
get formula of cell "B3"
log result (*= ""&A3*)
get value of cell "B3"
log result (*2016-03-29 00:00*)
tell me to set theDate to date theDate
log result (*date mardi 29 mars 2016 00:00:00*)
set value of cell "A4" to theDate
set value of cell "B4" to "= " & quote & quote & "&A4"
get value of cell "A4"
log result (*date mardi 29 mars 2016 00:00:00*)
date string of (get value of cell "A4")
log result (*mardi 29 mars 2016*)
get formula of cell "B4"
log result (*= ""&A4*)
get value of cell "B4"
log result (*29/03/2016 00:00*)
end tell
end tell
So, if we need to be able to extract the value which we inserted, my understanding is that we must insert a string value and use the auxiliary column with the formula =""&A1
Yvan KOENIG running El Capitan 10.11.4 in French (VALLAURIS, France) vendredi 1 avril 2016 17:49:29