In a OSX Cocoa app, I would like a button that would open the “speech” preference pane. Is that possible? I’m just trying to save them the time to go System Preferences > Speech > Text to Speech
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The following is a fairly easy (and reliable) way to at least get System Preferences open to the Speech.prefPane:
However, it won’t necessarily be switched to the
Text to Speechtab, but rather the last tab the user had selected.It is possible to actually switch to the Text to Speech tab as well, but it’s a bit more involved. You can use AppleScript to send commands to the System Preferences application, but using the
ScriptingBridge.framework(See Scripting Bridge Programming Guide) is much faster.You’ll need to add the
ScriptingBridge.frameworkto your project, and then use a command like the following in Terminal to generate aSBSystemPreferences.hheader file to work with:sdef "/Applications/System Preferences.app" | sdp -fh --basename SBSystemPreferences -o ~/Desktop/SBSystemPreferences.hAdd that
SBSystemPreferences.hheader to your project, then change-openSpeechPrefs:to the following:EDIT:
Sample project using the ScriptingBridge.framework method:
http://github.com/NSGod/OpenSystemPrefsTTS