Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Dictation in Mountain Lion is a nice little feature that works great for me. However I often need to switch between dictation languages, so going through the System Preferences is way too many clicks for me all the time. That's why I wrote a little utility that sits in the menu bar, which lets the user switch dictation languages. The problem is: it doesn't really work. At least not without logging out and back in.

My utility changes all the plist files that should be necessary to change, these are:

~/Library/Preferences/com.apple.speech.recognition.AppleSpeechRecognition.prefs.plist
~/Library/Preferences/com.apple.assistant.plist
~/Library/Preferences/com.apple.assistant.support.plist

(the last one actually just contains a BOOL value to turn dictation on/off)

As far as I can tell (and trust me, I've looked into it thoroughly!) these are the only files that are changed when changing the dictation language in the dictation preference pane. However when I change the language setting in my utility, and then trigger dictation, it sticks with the previous setting. So I suppose the dictation daemon(s) are not loading the changed file. No big deal, right? Just need to find the right daemons. Well, there are three main processes that seem to belong to dictation:

com.apple.assistantd

(this seems to be the actual dictation daemon, which will also spam the console)

com.apple.assistant_service

(not sure what this one does)

DictationIM.app

(this one renders the GUI for the feature, the little grey popup with the microphone)

However, killing these (or, in case of assistant_service/assistantd, stopping and restarting them with launchctl), doesn't do anything.

The changes that I make to the plist files are valid and good, because when I restart the computer or simply log out/back in, the new setting is used when triggering dictation.

Is there anything I've overlooked? Any plist that saves the locale? Or some cache file that I didn't find? I don't think so, because I really turned the whole system upside down during the weekend looking for it.

Any idea which (other) daemons are responsible and should be (re)started after making a change to the plist files?

Thanks for any pointers in the right direction!

Oh, and if I can get this thing to work, I'll release the utility as freeware.

EDIT: As promised, I'm releasing the utility as freeware. Grab it here: http://fouquet.me/apps/dictationswitcher/

I open-sourced it, too: https://github.com/fouquet/DictationSwitcher

share|improve this question
1  
Have you tried doing a "kill -HUP" of the processes instead of restarting them ? Also, for me, dictation also launches "imklaunchagent". –  Tyr Jul 30 '12 at 2:58
    
The "kill -hup" on DictationIM did it. Now I feel like an idiot not trying that in the first place. Please submit that as an answer, it works! Thanks! :) –  René Jul 30 '12 at 5:20
    
See also apple.stackexchange.com/questions/59323/… –  rds Oct 17 '12 at 21:02
add comment

1 Answer 1

up vote 3 down vote accepted

"kill -HUP" on DictationIM should reload the configuration ;)

share|improve this answer
    
Thanks again. I'll add some finishing brushes to my app and add the link later on when it's done. –  René Jul 30 '12 at 5:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.