• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: GUI Scripting to toggle "Announce Time"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GUI Scripting to toggle "Announce Time"?


  • Subject: Re: GUI Scripting to toggle "Announce Time"?
  • From: Philip Aker <email@hidden>
  • Date: Sun, 29 Jul 2007 08:34:29 -0700

On 2007-07-29, at 05:06:29, TjL wrote:

I don't need to toggle this item, but you should be able to work with:

defaults read com.apple.speech.synthesis.general.prefs TimeAnnouncementPrefs

Yes, that's what I tried in the script I wrote.

However, the announcements do not actually change just because the defaults are changed... once the defaults are changed the preference panel has to be opened for the change to be registered. Otherwise the OS doesn't seem to notice the change.

That's probably because the SpeechSynthesisServer is running when the change is made (problem with many cocoa apps). Consequently you'll probably have to kill it before writing the preference item and then restart it. You can get its location via:


ps -axwwopid,command

or

tell application "System Events" to name of every process


There have been a few posts to this list about similar situations where setting sliders in a preference pane via UI scripting do not stick (I filed a bug FWIW).


If you do really need UI scripting to solve this, search the archives for 'tell application "System Preferences"' or 'process "System Preferences"' and you'll be able to see how the widgets are addressed. You can use "every UI element" for bit by bit discovery. There's also: /Developer/Applications/Utilities/Accessibility Tools/ Accessibility Inspector.app and a third party app by Bill Cheeseman that can help you locate the UI elements you need to target.


Philip Aker email@hidden


_______________________________________________ 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
References: 
 >GUI Scripting to toggle "Announce Time"? (From: TjL <email@hidden>)
 >Re: GUI Scripting to toggle "Announce Time"? (From: Philip Aker <email@hidden>)
 >Re: GUI Scripting to toggle "Announce Time"? (From: TjL <email@hidden>)

  • Prev by Date: Re: GUI Scripting to toggle "Announce Time"?
  • Next by Date: Re: Address book
  • Previous by thread: Re: GUI Scripting to toggle "Announce Time"?
  • Next by thread: Re: GUI Scripting to toggle "Announce Time"?
  • Index(es):
    • Date
    • Thread