Update: I got it to work with a script I found and modified for my Mac Pro, Remote Buddy and an EyeTV Hybrid with remote that I had.
Here's the script I used (which specifically changes the audio output to "Digital Out"):
Code:
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.sound"
end tell
tell application "System Events"
if UI elements enabled then
try
tell application process "System Preferences"
tell tab group 1 of window "Sound"
click radio button "Output"
if (selected of row 3 of table 1 of scroll area 1) then --headset is selected
set selected of row 1 of table 1 of scroll area 1 to true
set deviceselected to "Digital Out"
set verbal_description to "Digital Out."
tell application "Finder"
set volume 7
end tell
else
set selected of row 3 of table 1 of scroll area 1 to true
set deviceselected to "Digital Out"
set verbal_description to "Digital Out."
tell application "Finder"
set volume 2
end tell
end if
end tell
end tell
tell application "System Preferences" to quit
tell me to activate
say verbal_description using "Trinoids"
display dialog "Audio output is now..." & return & return & "* " & deviceselected buttons {"Rock on"} default button 1 giving up after 2
on error
tell me to activate
display dialog "Please plug in the headset." buttons {"Whoops!"} default button 1
end try
else --GUI scripting is disabled
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.universalaccess"
end tell
display dialog "Please check the box called \"Enable access for assistive devices.\"" buttons {"Okay"} with icon 1 default button 1
end if
end tell
The above code would need to be modified to change the output to other outputs, and you could have a separate script for each one. I only needed it to switch to digital out. I also still have SoundSource running and can use that to toggle if I want, this script doesn't conflict with it, or visa versa.
Getting Remote Buddy to work with the script and my EyeTV remote was fairly easy, although the remote buddy UI was less intuitive than I was expecting, and the instructions aren't great. Basically, you need to use the Remote Buddy utility to build the custom action (using the Applescript above), then get the EyeTV remote to show up in hardware (or whatever remote you're using), then map whatever remote action you want to the custom action you've made.
Now all I need is my MX-600 universal remote to show up, so I can really tie everything together, and then my wife can listen to iTunes in the house without having to call me and walk her through the kludgey steps
