Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I add a countdown timer in Numbers?

I would like to add a coutdown timers to my numbers spreadsheet if possible. I know I could use an external widget or other software but I'd like to have it in numbers...


Thanks!


Charles

Numbers-OTHER, Mac OS X (10.5.8)

Posted on Aug 8, 2011 10:38 AM

Reply
Question marked as Top-ranking reply

Posted on Aug 10, 2011 11:23 AM

Okay thanks Vince.


I was hoping maybe there is some way to tell numbers to reference the system clock and "change the colour of a cell when 120 seconds pass" or something like that. Oh well, I'll just keep on using a seperate app.


Thanks for your reply though!


Charles

11 replies
Sort By: 
Question marked as Top-ranking reply

Aug 10, 2011 11:23 AM in response to vjdjr

Okay thanks Vince.


I was hoping maybe there is some way to tell numbers to reference the system clock and "change the colour of a cell when 120 seconds pass" or something like that. Oh well, I'll just keep on using a seperate app.


Thanks for your reply though!


Charles

Reply

Aug 11, 2011 11:43 AM in response to charles143

Here is a way to do a timer using Applescript.


You need a 2 row x 2 column table named TimeClock on Sheet 1 of your document.

Cell A2 is a checkbox

Cell B2 is formatted as a number

Row 1 is there for header text: On/Off, Seconds


Open the application AppleScript Editor

Paste in the Applescript

Run the Applescript.


When A2 is checked, the timer starts at zero then counts up.

When A2 is not checked, the timer stops and keeps the current count.



property storeddate : current date


tell application "Numbers" to tell document 1 to tell sheet 1

if exists table "TimeClock" then tell table "TimeClock"

set value of cell "b2" to 0

end tell

repeat

if exists table "TimeClock" then tell table "TimeClock"

if value of cell "a2" = true then

set value of cell "b2" to ((current date) - storeddate) as integer

else

set storeddate to (current date)

end if

end tell

end repeat

end tell


If that works for you, you can save it and run it from the script menu, create an application from it, or you can create a service using Automator and run it from the Services menu (and can assign a keyboard shortcut to it). You'll need some directions on how to do either.

Reply

Aug 11, 2011 5:02 PM in response to charles143

You can do the countdown in another table.

B2 =180

C2 =B2-TimeClock::B2


Or you can do it in one cell in the other table:

B2 = 180-TimeClock::B2


Or you can add a row to the TimeClock table:

B3=180-B2


Or you can modify the formula in the Applescript. In this case I am using cell B3 to specify the start time for the countdown. I don't know how to do a chime but I put a comment into the script to show where it would go.


property storeddate : current date


tell application "Numbers" to tell document 1 to tell sheet 1

if exists table "TimeClock" then tell table "TimeClock"

set value of cell "b2" to 0

end tell

repeat

if exists table "TimeClock" then tell table "TimeClock"

set starttime to value of cell "b3"

if value of cell "a2" = true then

set B2 to starttime - ((current date) - storeddate) as integer

if B2 < 0 then

set B2 to 0


(* do other stuff you want to do *)

end if

set value of cell "b2" to B2

else

set storeddate to (current date)

if value of cell "b2" ≠ starttime then

set value of cell "b2" to starttime

end if

end if

end tell

delay 1

end repeat

end tell


Note the addition of "delay 1" at the end. That should have been in the original script too. Takes a lot of processing time if you don't have it

Reply

Aug 8, 2011 3:51 PM in response to charles143

Charles, to the best of my knowledge, you won't be able to have an active timer in a Numbers sheet. You set up a table in a cell to see how much time is left between NOW() and some future date/time, but that will just pick it up when you load the table, not keep updating it as the seconds pass.


Vince

Reply

Aug 11, 2011 3:15 PM in response to Badunit

This is awesome thanks!


I hate to be picky at this point but is it possible to have the time count backwards in seconds from a set time (say 3 minutes) and then when it hits zero the script plays a system sound (like the built in Alert Sound under system preferences called "Hero")?


Thanks again!


Charles

Reply

Aug 12, 2011 10:02 AM in response to Badunit

Alas, I believe I am too amateur to figure Apple Script out...


When copying and pasting your text into script editor it just becomes all purple.


I then attempted to add the application Numbers into the applescript library and it said "Numbers is not scriptable."


I only have OSX Leopord and my version of numbers is '08 1.0.3


Sorry that I suck at this...

Reply

Aug 14, 2011 2:59 PM in response to charles143

Yes, it would not be good for timing something to the exact second.It doesn't lose any seconds but it might not display them at the exact time or it might skip the display of one (though I've not seen that happen). It also might be off by a partial second depending on when you start the timer.

Reply

How do I add a countdown timer in Numbers?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.