How to use applescript to toggle the language setting of new dictation tool (10.8)

I really like the new dictation feature of MacOSX Mountain Lion. I am using it in two languages; english (u.s.) and french.

Each time I need to switch language, I have to go in system preference, Dictation and Speech, and select the language.

Now, I would like use Applescript to do that automatically , unfortunately, since it is so new, I cannot get the proper string of dictation module.

Quick example (this is just a start):

tell application "System Preferences"
   activate
   set the current pane to pane id "com.apple.preference.xxxxxx"
end tell

for xxxx I tried "Dictation&Speech" a wild guess that did not work.

Any ideas on how I can get the exact string for "Dictation & Speech" ?

Thank in advance,

François


To get the id of a pane : go in system preference, select a pane, run this script in the Editor.

tell application "System Preferences" to get id of current pane

The result is the exact string.

How can I change the language for dictation on the fly?, You could either edit property lists that store the setting and reopen the to How to use applescript to toggle the language setting of new dictation tool (10.8)� Well, when I want to change languages, I just click on the name of the current language in the little dictation widget and get a menu: Clarification: the menu will only show you the languages you have enabled in the Dictation preference pane. So by default it only shows the main language of the O.S. installation.


You could either edit property lists that store the setting and reopen the DictationIM process:

#!/bin/bash

k="com.apple.speech.recognition.AppleSpeechRecognition.prefs DictationIMLocaleIdentifier"
if [[ "$(defaults read $k)" == en-US ]]; then
  defaults write $k fr-FR
  defaults write com.apple.assistant "Session Language" fr-FR
else
  defaults write $k en-US 
  defaults write com.apple.assistant "Session Language" en-US
fi
killall -HUP DictationIM

Or use UI scripting:

delay 0.3 -- time to release modifier keys if the script is run with a shortcut
tell application "System Preferences"
    reveal anchor "Dictation" 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
        if value is "English (United States)" then
            click menu item "French" of menu 1
        else
            click menu item "English (United States)" of menu 1
        end if
    end tell
end tell
quit application "System Preferences"

Changing the default text-to-speech voice - applescript - Python, How to use applescript to toggle the language setting of new dictation tool (10.8). I really like the new dictation feature of MacOSX Mountain Lion. I am using it in� MacScripter is a great place for Applescript help; someone has proabably already done what you want to do: MacScripter. There are also ways to get network location in the shell, which would be faster that Applescript. And there's MarcoPolo - Context-aware computing for Mac OS X, an app that will do what you want without writing an Applescript.


Cool stuff!

If you have 'Notifications Scripting' installed ( http://www.cooperative-fruitiere.com/notifications/index_en.html ), then you can even have a notification informing you about the language. And by the help of FastScripts, you can assign a keyboard shortcut to this script.

-- Switch the language of Mountain Lion's dictation
-- Here, we just toggle between English and German
-- Needs 'Notifications Scripting' ( http://www.cooperative-fruitiere.com/notifications/index_en.html )

delay 0.3 -- time to release modifier keys if the script is run with a shortcut
tell application "System Preferences"
    reveal anchor "Dictation" 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
        if value is "English (United States)" then
            set language to "German (Germany)"

        else
            set language to "English (United States)"
        end if
        click menu item language of menu 1
    end tell
end tell

quit application "System Preferences"

tell application "Notifications Scripting"
    set event handlers script path to (path to me)
    -- The user info parameter is a record. The supported data types are text, integer, real, boolean, date, alias, file and POSIX file.
    set dict to {theName:"Notifications Scripting", theVersion:"1.0", theScript:event handlers script path}
    display notification "Dictation Language" subtitle "Switched to:" message language
end tell

using terms from application "Notifications Scripting"
    -- This handler is called when a notification was delivered.
    on notification delivered title aTitle subtitle aSubTitle message aMessage actual delivery date aDeliveryDate user info aDict
    end notification delivered
end using terms from

applescript, How to use applescript to toggle the language setting of new dictation tool (10.8). I really like the new dictation feature of MacOSX Mountain Lion. I am using it in� Set the command to work in all apps or a specific one, then click the pop-up next to perform and select Run workflow. Apple provides a list of pre-made workflows to explore. As an example, look at the ones for controllingiTunes. And ask your Mac to play your favorite tune. Take your dictation and workflow to new levels using applescript and


The script provided doesn't work unless you put in a delay command. Also, it needs to be application process, not simply process. Instead of explaining where to make the changes, I'll just post the working code. [Please note, this was tested on macOS Catalina. If apple changes the System Preferences GUI in future versions, this code may not work.]

tell application "System Preferences"
    reveal anchor "Dictation" of pane "com.apple.preference.speech"
end tell
delay 1
tell application "System Events" to tell application process "System Preferences"
    tell pop up button 1 of tab group 1 of window 1
        click
        if value is "English (United States)" then
            click menu item "Hungarian (Hungary)" of menu 1
        else
            click menu item "English (United States)" of menu 1
        end if

    end tell
end tell
quit application "System Preferences"

Mac Automation Scripting Guide: Using Dictation to Run Scripts, New document. Launch System Preferences and open the Dictation & Speech Objective-C to AppleScript Quick Translation Guide. Hands-free voice-to-text How to use voice dictation on Windows 10 Windows 10 includes a new voice-to-text feature, and in this guide, we'll help you to get started with the experience.


Mountain Lion, OS X version 10.8, called "Mountain Lion," was released in July 2012. Dictation allows you to speak and have it translated to text. If you depend on the Classic environment to run Mac OS 9 programs from the 1990s, stick with OS X 10.4. Download the Apple Mountain Lion Recovery Disk Creator tool and burn a� To dictate in other languages, use Windows Speech Recognition. To use dictation, you will need to have a microphone and turn on online speech recognition services. Here's How: 1. With your cursor in any text field either in Windows 10 or in an app, press the Win+H keys. When you see dictation listening, you can start talking to type with your


Trans-Tex Software, This allows you to dictate and edit text before insertion. Added "New Tex-Edit Plus Window Containing Selection" service. Mountain Lion (10.8) compatible. (Edit the various formats in "System Preferences -> Language & Text (Press AppleScript Editor's "record" button and watch it record a script as you use Tex- Edit� Dictation lets you talk instead of type, and voice-to-text transcribes what you say into words on the screen. It's among the Mac's many accessibility features. All you have to do is set it up and get going. How to enable and use Dictation; How to change your Dictation language; How to enable and use Enhanced Dictation


[PDF] Dragon Dictate Medical for Mac v4 FAQs, Recorder – includes a headset and a digital voice recorder. What is new in Dragon Dictate licensing options. (10.8)?. Users of OS X Mountain Lion (10.8 ) may upgrade through the Mac AppleScript�. switch between medical specialties, language offerings, the company is creating a more human conversation with� Windows 10’s Fall Creators Update makes voice dictation much easier to use. Now, you can immediately begin dictation by pressing a key Windows+H on your keyboard. You don’t have to dig through the Control Panel and set anything up first. The old Speech Recognition tool is still accessible via the Control Panel. It has some advanced features