Changing the background colour of cells edited in the last 10 minutes
Hi,
I need to easily see the cells in a Numbers spreadsheet that I have updated in the last 10 minutes. I have put this applescript together with Chat GPT and some basic knowledge. I have triggered it in Automator and it runs and brings the correct spreadsheet to the front but the cells don't change colour. I am wondering if anyone is able to see what I am doing wrong?
After 10 minutes I need the cells to turn back to not having any background fill.
My Applescript skills are very basic and so I would appreciate any help?
on run {input, parameters}
tell application "Numbers"
activate
try
set theDocument to document "Placemats.numbers"
tell theDocument
set editedCells to {}
repeat with t in every table of every sheet
repeat with r in every row of t
repeat with c in every cell of r
if modification date of c is greater than ((current date) - (10 * minutes)) then
set end of editedCells to c
end if
end repeat
end repeat
end repeat
repeat with editedCell in editedCells
set background color of editedCell to {65535, 0, 0} -- Red color
end repeat
end tell
end try
end tell
return input
end run