Skip to content

Instantly share code, notes, and snippets.

@enosh
Last active November 21, 2020 16:33
Show Gist options
  • Select an option

  • Save enosh/5b89a7b4b7a16bca71ba6c24411905a5 to your computer and use it in GitHub Desktop.

Select an option

Save enosh/5b89a7b4b7a16bca71ba6c24411905a5 to your computer and use it in GitHub Desktop.
A small AppleScript to change the system voice that works with Siri voices. As opposed to options based on the `say` command which only work with older voices. (Also `defaults write` as far as I could tell.) I use it through Alfred.
tell application "System Preferences"
reveal anchor "TextToSpeech" of pane id "com.apple.preference.universalaccess"
activate
end tell
tell application "System Events"
tell application process "System Preferences"
set theGroup to group 1 of window "Accessibility"
set thePopUp to pop up button 1 of theGroup
click thePopUp
click menu item "Carmit" of menu 1 of the thePopUp -- Siri Male, Carmit
end tell
end tell
tell application "System Preferences"
quit
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment