A script to keep iCal's dock icon current

Feb 20, '03 08:47:00AM

Contributed by: greggo

If you keep iCal's icon in your dock the date on the icon is always wrong until you launch iCal. So, I wrote a simple script to launch and quit iCal:

tell application "iCal"
  activate
  quit
end tell
and saved it as an app in my applications folder as 'dockiCal.app'. Then I added this line to the end of my /etc/crontab file using the pico editor:
0[tab]0[tab]*[tab]*[tab]*[tab]root[tab]cd /Applications/ ; open ./dockiCal.app
[robg adds: replace [tab] with a press of the tab key]

This sets a cron job to run the script at midnight every night which, in turn, updates the date on the iCal icon in the dock. You'll need to keep your hard drive awake at midnight, as cron jobs won't activate on a sleeping drive.

[robg adds: You'll need to use sudo to edit the crontab file in /etc; another option is to create a crontab for your user, as explained in this hint.]

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20030214163614514