Skip to content

Instantly share code, notes, and snippets.

@nanoxd
Forked from mluisbrown/FixBTSound.applescript
Last active November 11, 2018 14:26
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 nanoxd/fb8bdde11366edc8984b172ea6933af7 to your computer and use it in GitHub Desktop.
Save nanoxd/fb8bdde11366edc8984b172ea6933af7 to your computer and use it in GitHub Desktop.
[FixBTSound] AppleScript to set macOS audio input device to "Internal Microphone"
-- Sets your audio input source to "Internal Microphone"
-- Frequently needed if you use bluetooth headpohones and
-- run the Xcode iOS simulator, which will often set your
-- headphones to be the input device, resulting in a drastic
-- decrease in sound quality, and making it mono
tell application "System Preferences" to activate
tell application "System Preferences"
reveal anchor "input" of pane id "com.apple.preference.sound"
end tell
delay 0.5
tell application "System Events" to tell process "System Preferences"
tell table 1 of scroll area 1 of tab group 1 of window 1
select (row 1 where value of text field 1 is "Internal microphone")
end tell
end tell
quit application "System Preferences"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment