Vocola Information Pages   by Rick Mohr   (last modified February 24, 2002)

 Introduction
 Using Vocola
 Language Tutorial
    Keystroke Commands
    Using Alternatives
    Defining Variables
    Substituting Actions
->     Function Calls
    Optional Words
    Comments
    Contextual Commands
    Example File
 Download Vocola
 Install Vocola
 Converting DVC Files
 Troubleshooting
 Support
 Wish List
 My RSI Story
 

Function Calls

Function Calls Not everything can be accomplished with keystroke sequences -- Vocola commands can also include calls to system functions. When writing commands for Dragon NaturallySpeaking, all system functions defined for the Dragon Macro Language are available.

Here are two simple examples:
 
 Vocola: Die Die = GoToSleep(); 
         Hit Down = ButtonClick(1,1); 

The first example puts NaturallySpeaking in sleep mode when you say "Die Die". The second example clicks the mouse when you say "Hit Down".

The function HeardWord is useful for writing a command which invokes another command. Any command recognized by NaturallySpeaking may be invoked this way, whether it was defined in Vocola, NatLink, or the Dragon Macro Language.

For example, maybe you'd like to say "Kill Word" to delete a word rather than using the built-in NaturallySpeaking command "Delete Next Word", but you don't want to take the time to figure out the exact keystroke sequence. This command does the trick:
 
 Vocola: Kill Word = HeardWord(Delete,Next,Word); 

A command's actions can be a mix of keystroke sequences and function calls. For example, this command performs a "paste" at the current mouse location (saving you a mouse click):
 
 Vocola: Paste Here = ButtonClick(1,1) {Ctrl+v}; 

Finally, you can use a reference to a variable term as an argument to a function call. For example, this command allows you to copy a window's contents to either NaturallySpeaking or Emacs, by saying "Copy to NatSpeak" or "Copy to Emacs":
 
 Vocola: Copy to (NatSpeak|Emacs) = {Ctrl+a}{Ctrl+c} AppBringUp($1); 

Here the result of the first variable term "(NatSpeak|Emacs)" is passed to the function AppBringUp to bring up the desired application.
 


This page is (c) Copyright 2002 by Rick Mohr, and was last modified on February 24, 2002.