Thanks for posting this script, and also posting a link to SoundSource. I'm consistently impressed by the quality of the the implementation of small free Mac utilities.