(* Audio output switching script. In its' present form it will toggle between the headphone port/internal speakers and the Logitech USB headset I use for gaming and VoIP Change the 'deviceselected' parameters as required to match your device names as found in System Preferences You will also need to have Growl installed to enable notifications Released by Jon Biddell under the Creative Commons Licence *) tell application "System Preferences" activate set current pane to pane "com.apple.preference.sound" end tell tell application "System Events" tell application process "System Preferences" tell tab group 1 of window "Sound" click radio button "Output" if (selected of row 2 of table 1 of scroll area 1) then set selected of row 1 of table 1 of scroll area 1 to true set deviceselected to "Headphones" else set selected of row 2 of table 1 of scroll area 1 to true set deviceselected to "Logitech USB Headset" end if end tell end tell end tell tell application "System Preferences" to quit tell application "GrowlHelperApp" set the allNotificationsList to {"Sound Notification"} set the enabledNotificationsList to {"Sound Notification"} register as application "Toggle Sound Output" all notifications allNotificationsList default notifications enabledNotificationsList icon of application "Script Editor" notify with name "Sound Notification" title "Audio Output" description deviceselected application name "Toggle Sound Output" end tell