Switching Sound Output with Dictate
August 26th, 2008 Posted in TechnologyI figured I would put the AppleScripts and information on how to build the macros for MacSpeech Dictate to switch between the different sound output options.
First up, here’s an image of all my sound output preference panel looks like. Most importantly to note on this is the name of the devices. In my case, I have two devices “Internal Speakers” and “Plantronics Headset”. These two names will need to be edited into the AppleScripts.
Make sure you have MacSpeech Dictate running and it is the active application. Go to the Tools menu and select Commands. This will bring up a list of all the scripts in the “Available Commands” box that MacSpeech Dictate shows as a tool. You’ll want to locate Globals for a list of all global scripts. Once you’ve clicked on Globals, click on the “+” symbol to create a new script.
In the command field, type what you want to say to start the script. Make sure the type is set to AppleScript. Cut and paste the following into the source:
tell application “System Preferences” to activate
tell application “System Events”
get properties
tell process “System Preferences”
tell application “System Preferences” to reveal anchor “output” of pane id “com.apple.preference.sound”
delay 2
set theRows to every row of table 1 of scroll area 1 of ¬
tab group 1 of window “sound”
set theOutputs to {} as list
repeat with aRow in theRows
if (value of text field 1 of aRow as text) ¬
is equal to “Internal Speakers” then
set selected of aRow to true
exit repeat
end if
end repeat
end tell
end tell
tell application “System Preferences” to quit
Please note the words “Internal Speakers”. This is where you will replace with the device name you want the script to switch to when it runs.
You’ll want to create a separate script for each output device that you have. I hope this helps, if a figure out how to program a script that will toggle through the various output devices I’ll be sure to post it.
