Toggle Clock window easily in 10.3 via Applescript

Apr 19, '04 09:53:00AM

Contributed by: chally

It drove me nuts that Apple made the clock window a pseudo-application in Panther, making it difficult, unlike "normal" applications, to show or hide (by changing system preferences). Every time I wanted to put in a DVD, I had to fuss with it. Thanks to a previous hint, an Applescript can now make this convenient. This script toggles the visibility of the clock window by running or quitting the hidden application. The Date and Time control panel will still allow you to change its characteristics, AND add it to the menubar as well.

-- Toggle Clock.scpt

tell application "Finder" to set theCount to ¬
  the count of (processes whose name is "WindowClock")

if theCount > 0 then
  tell application "WindowClock" to quit
else
  tell application "WindowClock" to run
end if
Save this script and put it somewhere easy to get to (dock, sidebar, toolbar, scripts menu, etc.), and you've got a quick and easy way to toggle the desktop clock on and off.

Comments (10)


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