Vuelvo a editar esto para mostrar la última revisión. Gracias a la ayuda de todos aquí y a algunas investigaciones propias, he podido conseguir que esto se ejecute en segundo plano evitando el uso de "eventos del sistema"
Muchas gracias a todos aquí, especialmente a @Tetsujin por toda la ayuda.
Mi último paso en esto es hacer que se actualicen 2 tablas diferentes en la misma hoja. 1 a intervalos de 10 minutos y 1 con intervalos de 1 minuto. Voy a probar mi suerte en él y publicar de nuevo si me quedo atascado.
set myTime to time of (current date) as string
set myAvg to 1.008
on roundThis(n, numDecimals)
set x to 10 ^ numDecimals
(((n * x) + 0.5) div 1) / x
end roundThis
repeat until myTime = 75600 -- stop at 9pm local time
set myTime to (round ((time of date ((current date) as string)) / 60) rounding down) mod 10 = 0 --every 10 minutes
if myTime then
say "getting data"
quit application "Numbers"
delay 1
tell application "Numbers" to open POSIX file "/Users/steve 1/Documents/document.numbers"
delay 1
--tell application "Numbers" to activate --only need this for testing
tell application "Numbers"
tell the table 1 of sheet 1 of document "document"
set myAvg to the value of cell "C36"
end tell
end tell
say roundThis(myAvg * 100, 2)
tell application "Numbers"
tell the table 1 of sheet 1 of document "document"
add column before the range "E1:E2"
set the value of cell "E1" to time string of (current date)
repeat with i from 2 to the count of cells of column "E"
set the value of cell i of column "E" to (the value of cell i of column "C")
end repeat
end tell
end tell
end if
delay 15 --less than 15 will cause it to get double triggered.
end repeat```