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


Click here to return to the 'An AppleScript to change sound output device' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to change sound output device
Authored by: Lri on Sep 03, '12 09:25:09PM

The second script could be simplified a lot:

  • reveal anchor "" of pane id "" reveals a specific tab
  • You don't have to make System Preferences frontmost or visible
  • You could use a single expression to select the UI element to click
tell application "System Preferences"
    reveal anchor "output" of pane id "com.apple.preference.sound"
end tell
tell application "System Events" to tell process "System Preferences"
    tell table 1 of scroll area 1 of tab group 1 of window 1
        select (row 1 where value of text field 1 is "Internal Speakers")
    end tell
end tell
quit application "System Preferences"


[ Reply to This | # ]