Get the Sound Output Device Name with AppleScript How can I get the current sound output device name with AppleScript?

For example, in my System Preferences: Sound pane "Internal Speakers" is currently selected. All I need to do is retrieve that device name -- "Internal Speakers" or "Headphones" or "Bluetooth Speakers" -- whichever is currently in use.

(I do not need a switcher/changer to another device.)
Just to help out a bit more:

In your main user directory /home// create a directory named 'bin' and put  SwitchAudioSource in there.

Here's some AppleScript which switches back and forth between two sources, the default 'headphone' mini jack output on the back of my Mac Mini (a laptop should be different), and my Sennheiser USB headsest.

Call me 'Captain Obvious', but here you go:

`on run

set theSwitch to "~/bin/SwitchAudioSource"
set theSource to do shell script theSwitch &amp; " -c"

if theSource = "Built-in Output" then
    do shell script theSwitch &amp; " -s \"Sennheiser USB headset\""
else
    do shell script theSwitch &amp; " -s \"Built-in Output\""
end if


end run`