Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'An AppleScript to change sound output device' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to change sound output device
Authored by: lras on Jan 21, '09 03:14:41AM
Neat! Your c program works like a charm! I created a QuickSilver trigger that runs a shell script that toggles the audio device using your command. I put your program in my $HOME/bin catalog. I also have installed the growlnotify program that comes with growl. I activated quicksilver (my trigger is alt-space) and then pressed "." (dot) to enter text. I then pasted in the script below

audio=$HOME/bin/SwitchAudioSource; $audio -s "$(basename "$($audio -a -t output | egrep -v "$($audio -c)")" " (output)")" | /usr/local/bin/growlnotify -a "System Preferences" -t "Sound Device"
Then I pressed tab to choose action, and I chose "Run Command In Shell". This will run the commands that were entered into QS's text buffer. I activated QS again and pressed command-' (quote) to get the trigger configuration pane. Then I added a trigger by clicking on the plus icon down on the popup window. This lets you choose which command to run, but the default is the one you just ran, so just add it and pick a nice shortcut (I picked control-alt-command a) QS rocks!

[ Reply to This | # ]