I am looking for a way to set different voices (2, to be precise) to the system settings. Voices - “Alex” for the English voice and “Thomas” for the French voice.
I tried the console directly, but failed, so I switched to the AppleScript language, but I never used that language.
The code that I have at the moment,
set osver to system version of (system info)
if osver is equal to "10.6.8" then
display dialog ("Downloading voices is only available in OS X Lion and higher")
else
tell application "System Preferences"
activate
reveal (pane id "com.apple.preference.speech")
end tell
try
tell application "System Events"
click radio button 2 of tab group 1 of window 1 of process "System Preferences"
repeat until (exists pop up button of tab group 1 of window 1 of process "System Preferences")
delay 2
end repeat
delay 2
click pop up button 1 of tab group 1 of window 1 of process "System Preferences"
delay 2
click menu item -1 of menu 1 of pop up button of tab group 1 of window 1 of process "System Preferences"
delay 2
end tell
on error
display dialog ("An error happend")
end try
end if
This program opens a voice box, but a display dialog box appears every time, regardless of the index that I put.
If you have another idea to upload voices, or if you can help me understand what is not working, I will be grateful.
source
share