Last active
August 29, 2015 13:57
-
-
Save eplt/9524703 to your computer and use it in GitHub Desktop.
An AppleScript to switch the Text-To-Speech voice from Daniel to Ting-Ting and vice versa. I use it because I often have to switch between English and Chinese TTS. I found this script online and modified it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Preferences" | |
activate | |
reveal anchor "TTS" of pane "com.apple.preference.speech" | |
end tell | |
tell application "System Events" to tell process "System Preferences" | |
tell pop up button 1 of tab group 1 of window 1 | |
click | |
delay 0.5 -- without this the value was sometimes "Loading Voices…" | |
if value is "Daniel" then | |
click menu item "Ting-Ting" of menu 1 | |
else | |
click menu item "Daniel" of menu 1 | |
end if | |
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