ludwip

Q: What is the keyboard shortcut for changing dictation language in Yosemite?

I can't find the keyboard shortcuts to change the dictation language in Mac OS X?
I would really appreciate if someone help me with this problem. I work with two languages and I really can't find any way to do that.
Thanks for your help guys

MacBook Pro with Retina display, OS X Yosemite (10.10.1), Mail forwarding problem

Posted on Apr 7, 2015 4:07 AM

Close

Q: What is the keyboard shortcut for changing dictation language in Yosemite?

  • All replies
  • Helpful answers

  • by Tom Gewecke,Helpful

    Tom Gewecke Tom Gewecke Apr 8, 2015 3:19 AM in response to ludwip
    Level 9 (79,371 points)
    Apr 8, 2015 3:19 AM in response to ludwip

    As far as I know there isn't one.  Try

     

    https://fouquet.me/apps/dictationswitcher/

  • by VikingOSX,Solvedanswer

    VikingOSX VikingOSX Apr 7, 2015 8:38 AM in response to ludwip
    Level 7 (21,061 points)
    Mac OS X
    Apr 7, 2015 8:38 AM in response to ludwip

    Until the developer can release dictationswitcher compatible with Yosemite, here is an AppleScript that will toggle between two languages. After it switches, it will speak which language has been set. Currently, the spoken text is in English (United States). This script will work on Yosemite and Mavericks. Tested.

     

    What you need to do to get this to work.

    1. Add your alternative language to the Dictation Language pop-up.
      1. Set your languages in the AppleScript property strings exactly as they appear in the Dictation Language Menu.
    2. Copy/Paste the following AppleScript into your Script Editor (/Applications/Utilities).
      1. Click the hammer (compile) button
      2. Save once as File format text (dictation.applescript) - don't hide the extension, or check any of the checkboxes.
      3. Option+Save As… File format Application to your Desktop. Hide the extension, and check no other checkboxes.

     

    The first time that you run this application, you will receive a dialog box just like the one below (I changed the name back to dictation):

    Screen Shot 2015-04-07 at 10.55.12 AM.png

    Click Open System Preferences. Click on the gold lock button in the lower left corner. The Accessibility category will be selected, but the dictation application in the list of apps will be unchecked. Check it, and then click the gold lock again. Quit out of the dictation application on your Desktop, and run it again. If you happen to get another dialog indicating that it still does not have permission, revisit the System Preferences > Security & Privacy panel, and under the Privacy tab > Accessibility, uncheck the dictation application, and then recheck it again. Quit System Preferences. This happened to me, and following this second action allowed it to work properly.

     

    Future releases of OS X may impact this application if Apple changes the order of the UI elements.

     

    I modified this AppleScript from an Apple StackExchange post by qegal in 2012.

     

    Copy/Paste the following AppleScript into your Yosemite Script Editor per the above instructions.

     

    property defaultLang : "English (United States)"

    property altLang : "German (Germany)"

    -- property altLang : "French (France)"

     

    tell application "System Events" to set p to (path to frontmost application) as string

         tell application "System Preferences"

         activate

              reveal anchor "Dictation" of pane "com.apple.preference.speech"

         end tell

         tell application "System Events"

              tell process "System Preferences"

                   tell pop up button 1 of tab group 1 of window "Dictation & Speech"

                        click

                        try

                             if (get value of attribute "AXValue") contains defaultLang then

                                 click menu item altLang of menu 1

                                 say "Dictation set to " & altLang

                             else if (get value of attribute "AXValue") contains altLang then

                                click menu item defaultLang of menu 1

                                say "Dictation set to " & defaultLang

                             end if

                       on error errmsg number errnbr

                             tell process "System Preferences" to if it is running then quit

                             display alert altLang & "not configured in Dictation Languages, please add." as critical giving up after 10

                       end try

                   end tell

           end tell

    end tell

    quit application "System Preferences"

    activate application p

  • by thisisadam,

    thisisadam thisisadam Nov 23, 2015 4:35 PM in response to VikingOSX
    Level 1 (0 points)
    Nov 23, 2015 4:35 PM in response to VikingOSX

    Thanks for this, it works great. You may get an error message, though, because the script tries to work on "tab group 1" before the window renders it. If so, add, before the "tell pop up button 1..." line:

     

    repeat until exists tab group 1 of window "Dictation & Speech"

      end repeat

  • by Timevibes,

    Timevibes Timevibes Jan 13, 2016 6:14 AM in response to ludwip
    Level 1 (0 points)
    Jan 13, 2016 6:14 AM in response to ludwip

    Hi Ludwip, is there a way to expand this code to toggle between 3-5 languages in a dropdown menu or key shortcut through FastScripts ?

    Thx