Tuesday, May 3, 2011

Setting House Clocks after Power Outage

Setting House Clocks after Power Outage - My power went out yesterday. I wanted a quick way to set all the house clocks accurately and easily.

I used the Mac's speech ability and scriptability to make a quick talking clock. I ran this script and turned up my speakers and set all the clocks in the house with ease:

while [ 1 ];do z=`date +%S`;if [ `expr $z % 5` -eq 0 ];then say `date "+%l %M and %S seconds"`;fi;done
Paste into a terminal window and press enter. Type Control+C to quit.

[crarko adds: I tested this, and it works as described. Note that this is bash shell syntax; if you use a different shell you may need to modify the script accordingly. I give it an A for cleverness.]

(Via MacOSXHints.com.)

No comments:

Post a Comment