Sound System Preference & AppleScript

Just wondering where is the best source of applescripts for Mac OS X software. I am currently trying to script the Sound System Preference, does anyone know if there has been some work done on this already and how feasible is it through applescript?

Also, I am trying to check/uncheck the ‘Mute’ checkbox in the Sound system preference but having problems, any ideas on how to do this

The simple answer is don’t use System Preferences.

Due to the plug-in nature of System Preferences, there is little or no support for AppleScripting preferences other than via GUI scripting, which is a poor substitute.

However, for this particular purpose you have a much easier option - just use the standard ‘set volume’ command:

set volume 0

violà

What are you trying to do? I have a script that uses GUI scripting to toggle between two audio outputs (Built-in audio and Griffin iMic).

Great, that script would be useful, where can I find it?

I’ll upload to this site, hopefully tonight. Search for something called “Toggle Sound Output” in the next couple of days.

What about changing input and output sources for audio ( or even enumerating them )
Is there a way to do this through cli perhaps, that we could hack around or build a standard set of functions for?