Hi folks.
I’m having problems with my scripts that choose sound outputs in System Preferences. This is one for my Logitech headset:
property speakers : "Line Out" --ext. speakers are connected to headphone output
property headset : "Headphones"
property Logitech : "Logitech H555 Headset"
set desired_output to Logitech
tell application "System Preferences" to activate
tell application "System Events"
tell process "System Preferences"
click menu item "Sound" of menu "View" of menu bar 1
click radio button "Output" of tab group 1 of window "sound"
set theRows to every row of table 1 of scroll area 1 of tab group 1 of window "sound"
repeat with aRow in theRows
if (value of text field 1 of aRow as text) is desired_output then
set selected of aRow to true
exit repeat
end if
end repeat
end tell
end tell
tell application "System Preferences" to quit
Here’s the problem. The System Preferences window comes up, but then the Sound Control Panel doesn’t get switched to. This is what error I am getting:
Any idea how I can make this happen?
Cheers