Hi,
First, thanks to everyone who contributed to this.
I'm hoping someone can help me with this. I've followed the steps on this thread, but I'm running into an inconsistent issue. Sometimes when I hit my hotkey, the notification comes up blank (does not reference an output), AND the output does not change. Anyone else run into this issue? Here is my script:
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 tab group 1 of window "Sound"
click radio button "Output"
if (selected of row 1 of table 1 of scroll area 1) then
set selected of row 3 of table 1 of scroll area 1 to true
set deviceselected to "Logitech USB Headset"
else
set selected of row 1 of table 1 of scroll area 1 to true
set deviceselected to "Speakers"
end if
end tell
end tell
quit application "System Preferences"
return deviceselected