GUI Scripting to toggle "Announce Time"?
GUI Scripting to toggle "Announce Time"?
- Subject: GUI Scripting to toggle "Announce Time"?
- From: TjL <email@hidden>
- Date: Sun, 29 Jul 2007 01:47:22 -0400
Short Version: I would like to be able to toggle the "Announce the
time" preference in System Preferences > Data and Time > Clock to
stop/start the announcement of time. However I have no experience
with GUI Scripting and wondered if anyone had already solved this
particular riddle.
Longer version:
I love having the time announced (much better than my wife calling me
at the office at 7pm to ask me if I know what time it is!) but I
don't really want/need it to tell me the time when I am home. (I use
a MacBook as my main computer both at the office and at home.)
I thought about creating a script that would check which Airport
network I am on and would set the preference accordingly (i.e. at
work = announce the time, anywhere else = don't).
I actually wrote a shell script that will toggle the preference
(which I'd gladly share if anyone had any interest) and while it does
successfully change the preference, OS X ignores that preference unless
1) System Preferences.app is opened
2) The Date & Time preference module is opened
3) The "Clock" Tab under Date & Time is opened.
I'm assuming this causes OS X to re-read the preference.
I can open /System/Library/PreferencePanes/DateAndTime.prefPane using
a shell script, but I don't know how to say "Open the 3rd tab of the
Date and Time preference panel"
And that tab (note just the preference panel for date/time) MUST be
opened for the preference to be re-read.
All I need is to be able to say
"Open Date and Time preferences. Open 'Clock' tab. Check box next
to 'Announce the time' and then close System Preferences"
and
"Open Date and Time preferences. Open 'Clock' tab. Uncheck box
next to 'Announce the time' and then close System Preferences"
I can write the script to check my Airport name easily enough myself.
I looked around for a few examples but nothing I found seemed
appropriate.
Any help would be appreciated.
Thanks!
TjL
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden