Actions
 Shorthand commands
 Meta actions
 BRINGUP details
 Unicode characters
 Actions configuration file
 Action classes for applications
Numbers and Spoken Forms
Unimacro and Vocola
Tracing
Inifiles
Translations
Cooperation with voicecoder
AutoHotkey
Unit testing
Grammar classes
Global dictation
Monitorfunctions

Unimacro Shorthand Commands

All these commands are in capitals, and they can perform ordinary things, which can be done in advanced script commands of NaturallySpeaking as well, but also more specialised things.

See "section on Vocola and Unimacro when you want to use Unimacro Shorthand Commands in Vocola.

Read the notes on Vocola and Unimacro if you want to use these functions in a Vocola User File.

Note: Also consult the file Unimacro.vch. This file contains more detailed information about quite a few of the functions below.

AutoHotkey support:

When you have installed AutoHotkey, you can call ahk scripts with this Unimacro Shorthand Command.

Unimacro

Vocola

result

AHK script

AHK(script)

Do a autohotkey script file (name.ahk) or script text (just the text of the script)

 

Bringup:

See also tasks grammar

Many applications are handled nicely with the AppBringUp command of NaturallySpeaking.

But in some cases extra work or tuning has to be done.

Previous BringUps are remembered, so repeated bringups can be handled more quickly.

Configuration through the file actions.ini (called by edit actions).

Unimacro

Vocola

result

BRINGUP app

BRINGUP(app)

Brings app in front (see also tasks grammar)

BRINGUP idle

BRINGUP(idle)

The IDE idle from Python

BRINGUP voicecoder

BRINGUP(voicecoder)

starts command prompt, mediator, emacs and voicecode. Switches to the correct user if needed.

When called repeatedly only the necessary actions are done.

 

Pressing the Windows modifier key.

command/examples

Vocola

result

WINKEY e

WINKEY(e)

Opens an Explorer window

WINKEY b

WINKEY(b)

Moves focus to the icon tray

WINKEY

WINKEY0()

Opens the Windows start menu

 

Entering (really pasting) Unicode characters into your screen:

First puts the given character on the clipboard and then tries to paste it into the current application via {ctrl+v}. Attempts to not disturb the clipboard by saving it beforehand and restoring it afterwards.

(see list of known unicode characters)

command

result

U Delta

U(Delta)

paste a Greek letter Delta (Δ)

U 916

U(916)

same (decimal 916 is the Unicode number for the above letter)

U 040A

U(040A)

same, but specified in hexadecimal (0x040a == 916)

 

Typing ASCII characters by their decimal character number:

command

result B

A 66

A(66)

types "B"

A 10

A(10)

types a newline character ({ctrl+j})

 

Here is the list of the simple things:

command

Vocola

explanation

HW

HW()

HeardWord or RecognitionMimic

SSK

SSK()

Shortcut name for SendSystemKeys

S

S()

Shortcut name for SendKeys.

Do this with a {shift} in front, in order to try workaround a bug in Dragon (idea from Frank Olaf Sem-Jacobsen)

W

W ()

Wait some time (default 0.1 seconds)

W time

W1( time )

Wait some specified time (in seconds)

SW

SW()

Wait a shorter time

LW

LW()

Wait a longer time

VW

VW()

Does a visible wait, so the user can see things happening

 

But also:

command

Vocola

explanation

KW

KW()

kill window: answers 'no' to the question if a document must be saved

KW {ctrl+f4}

KW1({ctrl+f4})

kill window with other key, for example killing a document window inside Excel (close document command)

RW

RW()

remember window, can be used afterwards by

WTC

WTC()

wait for title change (in this way you do not have to specify the waiting time

WWT window title

WWT("window title")

wait for window title (with a title specified) (note the quotes for Vocola!)

RTW

RTW()

return to window (which was remembered by RW)

SEARCH

not applicable

start search for a text, which parameters direction and optional search text, also see the commands that use this search command

 

(Note: for KW see also specification of top behaves like child

Some actions for a mouse: (a bit more documentation and below)

command

Vocola

explanation

MP ...

MP(...)

go to an absolute mouse position and click (parameters:

  • screenorwindow(0,1,2,3,4,5, see below) (3 and 4 added, November 2017)
  • x
  • y
  • clicking (see below)

RMP ...

RMP(...)

relative mouse position, values x and y between -1 and 1. (parameters:

  • screenorwindow(0,1,3,4,5), see below) (3 and 4 added, November 2017)
  • x
  • y
  • clicking (see below)

PRMP

PRMP()

print relative mouse positions (see below)

PMP

PMP()

print absolute mouse positions' (see below)

PRMP 1 or PMP 1

PALLMP()

print all relative and absolut mouse positions (see below)

RM

RM()

remember mouse, for cancelling mouse actions

MDOWN

MDOWN()

push down the mouse, after that you can freely drag by hand without pushing the button

CANCELMOUSE

CANCELMOUSE()

cancel a mouse down button and return to remembered mouse position (with RM)

ENDMOUSE

ENDMOUSE()

release the mouse button if it was pressed down before (by a MDOWN for example)

Screenorwindow values of the MP and RMP commands (first parameter in the call)

 

screenorwindow

explanation

0

complete screen

1

active window

2

relative to the current position (only for MP)

3

relative to the current monitor (added November 2017)

4

relative to the current monitor work area (excluding eg windows task bar of Dragon bar (added November 2017)

5

relative to the client area of or window (eg the body of an e-mail)

 

To click or not to click:

By default after a mouse command a single click is performed, but Vocola ALWAYS expects 4 parameters. The fourth parameter (clicking) can be:

clicking

comment

noclick

only move to a position, keep the mouse pressed if it was before

[{left|right|middle}][{click|double|down|up|release}]

do with one of the buttons one of the actions

left

the default clicking for "left" is "leftclick"

double

the default button for a click action is "left", so "leftdouble" in this example

down or leftdown

push left button down

release or up

after a push down, release the button (see also MDOWN() and ENDMOUSE() and CANCELMOUSE())

 

Examples without clicking:

command

Vocola

comment

MP 1, 10, 10, 0

MP(1, 10, 10, noclick)

positions the mouse near the top left corner of the active window (Note: 0 or noclick is equivalent)

RMP 5, 0.5, 0.5, 0

RMP(5, 0.5, 0.5, noclick)

positions the mouse in the centre of the "client area"

 

Examples with clicking:

command

Vocola

comment

MP 2, 0, 0, left

MP(2, 0, 0, click)

no move, only a click (left and click are equivalent)

MP 0,10, 10, right

MP(0,10, 10, right)

right clicking in top left corner

RMP 0, 0.01, -0.01, left, 2

RMP(0, 0.01, -0.01, double)

bottom left corner, double click (Note: leftdouble is also correct)

 

The commands MP and RMP are wrappers around the function doMouse in natlinkutilsqh.

Tasks and Icons

(See grammar tasks for use of these and install instructions)

command

Vocola

action/explanation

TASK n

not applicable

Go to the specified task on the taskbar (see grammar tasks)

(n is the task number)

TASKOD

TASKOD()

Send the task to the other display (monitor) (applicable when you have 2 monitors)

Leaves task in maximized or restored state. The restore position is calculated in proportion with the monitor dimensions.

TASKMAX

TASKMAX()

Maximize the task

TASKMIN

TASKMIN()

Minimize the task

TASKRESTORE

TASKRESTORE()

Put task in Restore position. If restore area falls outside the current monitor, it is brought inside the monitor area.

TOCLOCK n

not applicable

Goes to the taskbar clock position

  • n = 0 or not given: no click
  • n = left: left click (or not given)
  • n = right: right click
  • by left clicking (TOCLOCK left) you get focus on the system tray.
  • by right clicking on the clock in the system tray you get the taskbar menu (TOCLOCK right)
  • TOCLOCK (without parameters) just positions the mouse above the clock in the system tray

 

Getting a mouse position

A list of the different MP and RMP actions for an actual mouse position can be obtained by the following global commands (from the commands grammar in an English speech profile provided you didn't change the commands). The list is printed in the python messages window.

Voice command

Shorthand command

in Vocola

print absolute mouse position

PMP

PMP()

print relative mouse position

PRMP

PRMP()

print all mouse positions

PMP 1

PALLMP()

 

Clipboard

command

Vocola

action/explanation

CLIPSAVE

CLIPSAVE()

save the clipboard for later restore

CLIPRESTORE

CLIPRESTORE()

restores the previous saved clipboard

CLIPISNOTEMPTY

see below

this command returns true if the clipboard is not empty, so the actions can continue.

If the clipboard IS empty False is returned and the command will break off. As a side effect CLIPRESTORE is called.

SCLIP text

SCLIP(text)

sends the text by putting it on the clipboard and then press ctrl+v. This can possibly circumvent problems with different language keyboards, like the German keyboard layout.

The previous content of the clipboard is saved before this action and restored after.

so these commands should go together:

CLIPSAVE; do something; optional CLIPISNOTEMPTY; continue if clip is not empty; CLIPRESTORE

in Vocola: Unimacro("CLIPSAVE; do something; optional CLIPISNOTEMPTY; continue if clip is not empty; CLIPRESTORE");

In each case the saved clipboard is restored.

 

Date and Time

command

Vocola

action/explanation

DATE

DATE()

Type (print) or Read (see parameter what) the current date

Default format is the %m%d, and by this default extra zeroes are stripped (eg 01/07 becomes 1/7 (being January 7)

DATE format

DATE1(format)

Specify the format of your date eg

  • %m/%d (default for print, but leaves zero's (like 01/07)
  • %B %d (long month day) (default for speak see below, eg January 7)
  • %m-%d-%Y (month-day-long year eg (01-22-2010)
  • you can specify 0 for default, also for the next case

DATE format, what

DATE2(format, what)

By setting what to speak, the date is spoken on your speakers/headset.

  • You can take the default format by entering 0
  • You can optionally specify what as print or as 0, taking the default (print)
  • See the file Unimacro.vch for Vocola examples, see SPEAK below for speaking other text.

TIME

TIME()

Type or Read (see parameter what) the current time

TIME format

TIME1(format)

specify the format of your time eg

  • %H:%M meaning "hour:minute" (default)
  • you can specify 0 for default, also for the next case

TIME format, what

TIME2(format, what)

By setting what to speak, the time is spoken on your speakers/headset.

  • You can leave the format to 0, taking the default format
  • You can opionally specify what as print or as 0
  • See the file Unimacro.vch for Vocola examples

 

Miscellaneous commands

command

Vocola

action/explanation

SPEAK text

SPEAK(text)

the computer speaks text (with TTSPlayString) on your speaker or headset

PRINT text

PRINT(text)

print text to the Messages of Python Macros windowyour speaker or headset

MSG text

MSG(text)

gives a message on the screen, with OK to answer.

MESSAGE text

MESSAGE(text)

YESNO text

Unimacro("YESNO do you want to proceed; actions only if yes was answered");

Asks a question. If No is answered it will return false and the rest of the actions will not be executed.

Note: The microphone is switched ON if it was "off" or "sleeping". It should NOT be switched off while answering (either with the mouse or by voice). Otherwise a UserWarning exception is raised and the performing macro is stopped.

T and F

T () and F ()

return True and False respectively, for testing mainly

Note: All these shorthand commands can be used inside a grammar and (see the examples and Unimacro.vch) in Vocola commands.