Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Toggle Clock window easily in 10.3 via Applescript System
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.
    •    
  • Currently 3.50 / 5
  You rated: 5 / 5 (4 votes cast)
 
[11,698 views]  

Toggle Clock window easily in 10.3 via Applescript | 10 comments | Create New Account
Click here to return to the 'Toggle Clock window easily in 10.3 via Applescript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Toggle Clock window easily in 10.3 via Applescript
Authored by: DougAdams on Apr 19, '04 11:26:13AM

Just a thought: Apple recommends using "System Events" rather than "Finder" when checking for processes.



[ Reply to This | # ]
Toggle Clock window easily in 10.3 via Applescript
Authored by: chally on Apr 19, '04 02:56:33PM
I was unaware of that. So the script would then look like this:
-- Toggle Clock.scpt

tell application "System Events" 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


[ Reply to This | # ]
Toggle Clock window easily in 10.3 via Applescript
Authored by: DougAdams on Apr 20, '04 07:24:18AM
Or this nuanced variation:
tell application "System Events"
	if (get name of processes contains "WindowClock") then
		tell application "WindowClock" to quit
	else
		tell application "WindowClock" to run
	end if
end tell
Whatever! Enjoyed the idea. : )

[ Reply to This | # ]
How to make analog?
Authored by: SOX on Apr 20, '04 03:41:38PM

Personally I prefer my window clock to be analog and my menubar clock to be digital. How can this script be modified to tell the clock to be analog when its in a window and digital when its is not



[ Reply to This | # ]
How to make analog?
Authored by: chally on Apr 20, '04 08:18:13PM
To my knowledge you cannot have an analog window clock and digital menu clock. The reason for this is that they've merged the functionality of the Clock application and the menu clock. This means they both look at the same prefs, and you have to run them (except as noted) from the Date and Time control panel. [breaking news--on a whim, I just selected "View as digital" from my PowerBook's clock on the menu bar, and it worked--and it didn't change the clock window...now you may have to do this every time you boot and/or log in, or you may wish to set up a Quickeys shortcut to do it, because Applescript's not going to help you here]

At this point, I suspect you'll be looking for a clock substitute. I'm not sure, but if you run X11 on Panther, perhaps you can run XClock and it will do what you want. Otherwise, you might want to look on VersionTracker for a substitute.

Of course, the other thing you can do, that never hurts, is the first thing I did--bitch to Apple through their OS X customer OS X Feedback Link, telling them you want the old clock application back AND you want to keep the menu bar clock too. I don't see why there has to be an either/or to it.

[ Reply to This | # ]

How to make analog?
Authored by: cougar718 on Apr 21, '04 04:50:22PM

With this hint, you can have both. FYI. you should test the hint before commenting if it will work or not.


---
Rick alias cougar



[ Reply to This | # ]
How to make analog?
Authored by: allanmarcus on Apr 26, '05 01:19:38PM

I read the hint and I still don't see how to make the menubar digital and the window analog. your help would be appreciated.



[ Reply to This | # ]
How to make analog?
Authored by: BitBlaster on Apr 02, '06 10:23:16AM

Use System Prefs to set the menu bar the way you want (digital). Then start the desktop windowed version, and right click it to change to analog.

I don't know a way to make this preference stick between logins but am looking...



[ Reply to This | # ]
How to make analog?
Authored by: chally on Dec 13, '06 09:51:19AM
With this hint, you can have both. FYI. you should test the hint before commenting if it will work or not.
I did test the hint. I wrote it. It works.

[ Reply to This | # ]
Toggle Clock window easily in 10.3 via Applescript
Authored by: macsolve on Oct 26, '04 06:01:14AM

Clock.app from 10.2 runs fine under Panther so if you can get hold of the old Clock.app you can simply hide the clock app when you want it out of sight, and it should also let you have digital menubar clock at the same time as an analog floating clock.



[ Reply to This | # ]