Skip to content

Instantly share code, notes, and snippets.

@blakewatson
Last active July 18, 2023 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blakewatson/062dcd470463024b97df2b7650f3b55c to your computer and use it in GitHub Desktop.
Save blakewatson/062dcd470463024b97df2b7650f3b55c to your computer and use it in GitHub Desktop.
AppleScript for setting specified audio input device
do shell script "open x-apple.systempreferences:com.apple.Sound-Settings.extension"
delay 1
tell application "System Events" to tell process "System Settings"
tell table 1 of scroll area 1 of group 2 of scroll area 1 of group 1 of group 2 of splitter group 1 of group 1 of window "Sound"
select (row 1 where value of static text 1 of group 1 of UI element 1 is "YOUR MICROPHONE NAME HERE")
end tell
end tell
delay 1
tell application "System Settings" to quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment