Skip to content

Instantly share code, notes, and snippets.

@lfender6445
Last active November 7, 2022 19:25
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lfender6445/d8361e084057214798a1ccb0cbea32ac to your computer and use it in GitHub Desktop.
Save lfender6445/d8361e084057214798a1ccb0cbea32ac to your computer and use it in GitHub Desktop.
AppleScript - Switch to hardware mic
-- Force mac book pro 10.13.3 to switch audio input to hardware mic
tell application "System Preferences" to activate
tell application "System Preferences"
reveal anchor "input" of pane id "com.apple.preference.sound"
end tell
tell application "System Events" to tell process "System Preferences"
select (row 1 of table 1 of scroll area 1 of tab group 1 of window "Sound" whose value of text field 1 is "Internal Microphone")
end tell
quit application "System Preferences"
@lfender6445
Copy link
Author

lfender6445 commented Jul 23, 2021

@mustafc you need a way too run apple scripts (save it as a .scpt file first)

have a read through https://www.techradar.com/how-to/computing/apple/terminal-101-running-applescripts-from-the-terminal-1305736

@mustafapc19
Copy link

@lfender6445 Thanks for the help. I used FastScript and mapped a keyboard shortcut to the script. Otherwise, it's a big pain since every time I pair the airpods I have to do it again. Thanks for the help tho :)

@crisdeoliveira
Copy link

i have this error when i run, any ideas?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment