deweller/switchaudio-osx

Bug with Audio name containing "(" or ")"

samleemc opened this issue · 2 comments

Hi There,

I would like to report a bug, the application give an bash error when the audio name contain any of the "(" or ")" or other symbol.

terminal log as below:

Sams-MacBook-Pro:~ sam$ switchaudiosource -a
USB PnP Sound Device (input)
CalDigit Thunderbolt 3 Audio (input)
MacBook Pro Microphone (input)
DisplayPort (output)
CalDigit Thunderbolt 3 Audio (output)
MacBook Pro Speakers (output)
Sams-MacBook-Pro:~ sam$ switchaudiosource -c
CalDigit Thunderbolt 3 Audio
Sams-MacBook-Pro:~ sam$ switchaudiosource -t output -s CalDigit Thunderbolt 3 Audio (output)
-bash: syntax error near unexpected token ('`

That's a bash: syntax error, nothing to do with our app. Use quoting

switchaudiosource -t output -s "CalDigit Thunderbolt 3 Audio (output)"

nice! I didnt know we need to add the quote " "

Can you add this to the "help" so that we can make it obvious to other user?