• 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
GUI - radio button "Clock"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GUI - radio button "Clock"


  • Subject: GUI - radio button "Clock"
  • From: Robert Poland <email@hidden>
  • Date: Mon, 26 Jan 2004 15:02:41 -0700

Thanks to Chris I finally got the Mute function to work. Now I can't click on the radio button "Clock", same error.

tell application "System Preferences"
activate -- without this the preference window stays in the background
tell application "System Events"
tell process "System Preferences"
activate
tell menu "View" of menu bar 1 to tell menu item "Date & Time" -- of menu "View" of menu bar 1
click
tell window "Date & Time"
tell tab group 1
tell radio button "Clock"
click
end tell
tell group 1
tell checkbox "Show the date and time" to if value is 0 then

repeat until value is 1
click
end repeat
end if
end tell
end tell
end tell
-- keystroke "l" using command down -- select window "Show All Preferences"
-- keystroke "h" using command down -- hide Preferences
end tell
end tell
end tell
end tell


I asked our resident expert, and got this response:

Things are not always as they seem just by looking at the screen. The "Mute" check box is inside "group 1". One must probe the UI to learn the containment, nesting "tell" blocks along the way.

tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.sound"
end tell
tell application "System Events" to tell process "System Preferences" to tell window "Sound"
tell group 1 --the "Mute" check box is inside group 1
--get properties of every UI element --this is the probe
tell checkbox "Mute"
click
end tell
end tell
end tell


--Chris Nebel
AppleScript Engineering

On Jan 26, 2004, at 8:33 AM, Robert Poland wrote:

Chris,

I tried the list and got no reply, so I thought maybe you would help.
OS 10.3.2.

The following, and lots of variations mostly give the error.

"System Events got an error:
NSReceiverEvaluationScriptError: 4"

tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.sound"
end tell
tell application "System Events" to tell process "System Preferences" to tell window "Sound"
tell checkbox "Mute" --to if value is 0 then
-- repeat until value is 1
click
-- end repeat
end tell
end tell

Tia,
--
Bob Poland - Englewood, CO
http://www.ibrb.org/


--
Bob Poland - Englewood, CO
http://www.ibrb.org/
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: applescript and browsers
  • Next by Date: Re: Scripting Additions 'Read' has stopped reaching EOF?
  • Previous by thread: sound input level
  • Next by thread: Running a script in both OS 9 and 10
  • Index(es):
    • Date
    • Thread