bundleid cn.alanhe.switch-audio category Self-Dev connections 1450496C-74BC-4EDE-930B-ADC6027C5449 destinationuid FCE19CD4-E3AE-4361-8B59-F357914A629C modifiers 0 modifiersubtext vitoclose 3AE8EB58-5F7D-49B6-98C1-4BAE5E79FC2E destinationuid 39B059B1-CD01-4C2D-8907-1E2F9262CD04 modifiers 0 modifiersubtext vitoclose B066EEAB-4F3C-4516-9F00-E8FD7A5439B6 destinationuid 3AE8EB58-5F7D-49B6-98C1-4BAE5E79FC2E modifiers 0 modifiersubtext vitoclose FCE19CD4-E3AE-4361-8B59-F357914A629C destinationuid 39B059B1-CD01-4C2D-8907-1E2F9262CD04 modifiers 0 modifiersubtext vitoclose createdby Alan He description Quickly switch sound output or input disabled name Switch Audio objects config lastpathcomponent onlyshowifquerypopulated removeextension text title Switched to {query} type alfred.workflow.output.notification uid 39B059B1-CD01-4C2D-8907-1E2F9262CD04 version 1 config alfredfiltersresults alfredfiltersresultsmatchmode 0 argumenttreatemptyqueryasnil argumenttrimmode 0 argumenttype 1 escaping 102 keyword sound queuedelaycustom 3 queuedelayimmediatelyinitially queuedelaymode 0 queuemode 1 runningsubtext waiting script set devices to {} tell application "System Preferences" reveal pane id "com.apple.preference.sound" end tell tell application "System Events" tell application process "System Preferences" repeat until exists tab group 1 of window "Sound" end repeat tell tab group 1 of window "Sound" click radio button "Output" tell table 1 of scroll area 1 set selected_row to (first UI element whose selected is true) set currentOutput to value of text field 1 of selected_row as text repeat with r in rows try set deviceName to value of text field 1 of r as text set end of devices to deviceName end try end repeat end tell end tell end tell end tell if application "System Preferences" is running then tell application "System Preferences" to quit end if set text item delimiters to "‡" set devicesStr to devices as text set comm to "bash ./main.sh" & " \"" & devicesStr & "\""& " \"" & currentOutput & "\""&" output" do shell script comm scriptargtype 1 scriptfile subtext select a device to sound output title sound type 6 withspace type alfred.workflow.input.scriptfilter uid B066EEAB-4F3C-4516-9F00-E8FD7A5439B6 version 3 config concurrently escaping 68 script on run argv set theQuery to item 1 of argv tell application "System Preferences" reveal pane id "com.apple.preference.sound" end tell tell application "System Events" tell application process "System Preferences" repeat until exists tab group 1 of window "Sound" end repeat tell tab group 1 of window "Sound" click radio button "Output" tell table 1 of scroll area 1 select (row 1 where value of text field 1 is theQuery) end tell end tell end tell end tell if application "System Preferences" is running then tell application "System Preferences" to quit end if return theQuery end run scriptargtype 1 scriptfile type 6 type alfred.workflow.action.script uid 3AE8EB58-5F7D-49B6-98C1-4BAE5E79FC2E version 2 config concurrently escaping 68 script on run argv set theQuery to item 1 of argv tell application "System Preferences" reveal pane id "com.apple.preference.sound" end tell tell application "System Events" tell application process "System Preferences" repeat until exists tab group 1 of window "Sound" end repeat tell tab group 1 of window "Sound" click radio button "Input" tell table 1 of scroll area 1 select (row 1 where value of text field 1 is theQuery) end tell end tell end tell end tell if application "System Preferences" is running then tell application "System Preferences" to quit end if return theQuery end run scriptargtype 1 scriptfile type 6 type alfred.workflow.action.script uid FCE19CD4-E3AE-4361-8B59-F357914A629C version 2 config alfredfiltersresults alfredfiltersresultsmatchmode 0 argumenttreatemptyqueryasnil argumenttrimmode 0 argumenttype 1 escaping 102 keyword voice queuedelaycustom 3 queuedelayimmediatelyinitially queuedelaymode 0 queuemode 1 runningsubtext waiting script set devices to {} tell application "System Preferences" reveal pane id "com.apple.preference.sound" end tell tell application "System Events" tell application process "System Preferences" repeat until exists tab group 1 of window "Sound" end repeat tell tab group 1 of window "Sound" click radio button "Input" tell table 1 of scroll area 1 set selected_row to (first UI element whose selected is true) set currentOutput to value of text field 1 of selected_row as text repeat with r in rows try set deviceName to value of text field 1 of r as text set end of devices to deviceName end try end repeat end tell end tell end tell end tell if application "System Preferences" is running then tell application "System Preferences" to quit end if set text item delimiters to "‡" set devicesStr to devices as text set comm to "bash ./main.sh" & " \"" & devicesStr & "\""& " \"" & currentOutput & "\"" &" input" do shell script comm scriptargtype 1 scriptfile subtext select a device to sound input title voice type 6 withspace type alfred.workflow.input.scriptfilter uid 1450496C-74BC-4EDE-930B-ADC6027C5449 version 3 config alfredfiltersresults alfredfiltersresultsmatchmode 0 argumenttreatemptyqueryasnil argumenttrimmode 0 argumenttype 2 escaping 102 keyword camera queuedelaycustom 3 queuedelayimmediatelyinitially queuedelaymode 0 queuemode 1 runningsubtext waiting script /usr/local/bin/node ./index.js scriptargtype 1 scriptfile subtext list camera title camera type 0 withspace type alfred.workflow.input.scriptfilter uid 33EDD99E-D237-4696-BCA8-E11E341697BE version 3 readme Easy to switch audio/list camera. Support Monterey 12.0.1,Does not support Ventura/Sonoma ## Requirement brew install node uidata 1450496C-74BC-4EDE-930B-ADC6027C5449 xpos 35 ypos 435 33EDD99E-D237-4696-BCA8-E11E341697BE xpos 40 ypos 675 39B059B1-CD01-4C2D-8907-1E2F9262CD04 xpos 685 ypos 120 3AE8EB58-5F7D-49B6-98C1-4BAE5E79FC2E note setSound xpos 340 ypos 125 B066EEAB-4F3C-4516-9F00-E8FD7A5439B6 xpos 35 ypos 125 FCE19CD4-E3AE-4361-8B59-F357914A629C note setVoice xpos 335 ypos 430 userconfigurationconfig variablesdontexport version 2.3 webaddress https://github.com/alanhg/alfred-workflows/tree/master/switch-audio