The location of growlnotify doesn’t matter. He was just wondering if you were 
referring to a location that didn’t exist.

With all the quotes and variables in that command, I wonder if some are getting 
screwed up somewhere. I’m surprised it works at all with double-quotes nested 
inside double-quotes, but if you say it works on the command-line, maybe it 
does. That’s obviously bash syntax and I don’t use bash much.

I’m sure it could be made to work, but it might be easier to put it in a script 
and just call the shell script instead. If you want to try, so this:

Make a folder for your scripts: mkdir ~/bin

Save those commands to a plain-text file with no extension in ~/bin. Something 
like:

    #!/usr/bin/bash
    audio=$HOME/bin/SwitchAudioSource
    $audio -s "$(basename "$($audio -a -t output | egrep -v "$($audio -c)")" " 
(output)”)”
    /usr/bin/growlnotify -a "System Preferences" -m "Output device has been 
switched." -t "Audio"

Make it executable: chmod +x ~/bin/whatever

Run it: ~/bin/whatever

If that works, you should be able to create a trigger that runs it too.

-- 
Rob McBroom
<http://www.skurfer.com/>

Reply via email to