(Note: I have written two different introductions to NatLink, this page is written for NatSpeak users who want to know what this Python stuff is all about.  The next page is written for Python users who want to know what this Dragon NaturallySpeaking thing is all about.)

What is Python?

Python is an interpreted, interactive, object-oriented programming language which has become increasing popular.  Many people compare Python to Perl, and although Python can do most of the tasks that Perl can do, Python is richer and more powerful.

Python is available on most computing platforms, although only the Windows version is of interested to users of Dragon NaturallySpeaking.  Python is copyrighted but is freely usable and distributable, even for commercial use.

Because Python is interpreted and because Python easily interfaces to other systems by using C extension modules, Python makes an ideal macro language for other programs, including Dragon NaturallySpeaking.  It is relatively easy to learn and very powerful.  And with NatLink, my interface between Python and Dragon NaturallySpeaking, you can use Python to write macros which are a lot more powerful and flexible than macros written using the build-in NatSpeak macro language.

You can learn all about Python from the main Python web site: http://www.python.org.

You will not have to become a Python expert in order to use Python as a macro language for Dragon NaturallySpeaking.  I provide enough examples which you can modify that you should be able to get started with little or no trouble.  But you will need to know the basics of Python so I recommend a book.  There are two books which teach Python.  

The book I recommend is called Learning Python (Mark Lutz, etc.).  This is a newer book (which means that it is more up to date with the latest version of Python).  It also seems to be better suited to learning the language from scratch.

The other big Python book is Programming Python (Mark Lutz).  This is a larger, more through treatment of the language.  But it is older so it is a little out of date in spots.  It is also a little harder to get through since it covers more advanced topics.

What is NatLink?

NatLink is a C++ program which extends the Python programming language so you can access and control Dragon NaturallySpeaking directly from Python.  NatLink is also a Dragon NaturallySpeaking compatibility module.  This means that Dragon NaturallySpeaking will automatically load NatLink and use NatLink to communicate with one or more applications.

The term compatibility module is not very common but you have used them before.  NaturalText is the most obvious compatibility module.  It is automatically loaded when Dragon NaturallySpeaking starts and allows you to dictate into 3rd party applications by sending them keystrokes.  NaturalText also contains the code which interprets macros from the global.dvc file.  All built in macros, and any macros you write using the Professional Edition are executed using the NatLink compatibility module.

NatLink is another compatibility module like NaturalText.  When installed, NatLink will allow you to load and recognize command grammars which are defined in one or more Python source files.  Then, when your commands are recognized, your Python code is called to perform the appropriate actions.  

NatLink does not replace NaturalText or Dragon NaturallySpeaking's built-in command and control system.  Instead, NatLink coexists with it  (as long as the command phrases you write in Python are different than the command phrases built-in to NatSpeak or added to your global.dvc file.)

In addition, using NatLink and writing your macros in Python has a number of advantages over writing your macros in the Dragon NaturallySpeaking native command and control language.

   NatLink allows you to write macros with any version of Dragon NaturallySpeaking, not just the Professional version.
   Commands you specify using NatLink can be much richer than the simple sentences that you are restricted to using with NatSpeak's native grammars.  With the NatLink grammars, you can include optional words, alternative words, repeating words, nest other sentences in your command grammars and more.
   NatLink allows you to create exclusive grammars which turn off all other grammars.
   NatLink allows you to change which grammars are active at the start of every recognition based on (almost) any conditions you want.
   Python is a much richer programming language for macros.  You can do much more complex command processing in Python than you can do in Dragon's native grammar language.
   With NatLink, you have multiple macros files.  You are not restricted to having only one global.dvc.
   With NatLink you can edit your macros with your favorite text editor and reload the changed macros into Dragon NaturallySpeaking without having to restart NatSpeak.

Of course there is a down side.  Here are some things which you should be aware of if you decide to use NatLink and Python to write macros:

   NatLink is not a supported product.  There is no technical support.  There may be bugs which I may not get around to fixing.
   Although NatLink works with existing versions of Dragon NaturallySpeaking, and will probably work with the next version of Dragon NaturallySpeaking, there is no guarantee that NatLink will work with any future version of Dragon NaturallySpeaking.
   The documentation is not as good as you would expect from a real product.
   There is no fancy user interface.  You will have to create macros by editing text files in your favorite text editor.
   You will have to learn (at least some) Python to take advantage of NatLink.

On November 9, 1999, I gave a talk all about using NatLink to write macos for Dragon NaturallySpeaking to the Boston Voice User's Group.  You can download that talk to help introduce you to using NatLink (NatLinkTalk.ppt).  The sample programs discussed in the presentation have been added to the Natlink distribution (as of version 004).

That said, you are ready to move on.  Skip the next page which was written for Python programmers who need to learn about Dragon NaturallySpeaking and move ahead to NatLink Copyright and Licensing Details.
Web page hosting graciously provided by
Synapse, a provider of speech recognition solutions.