## WorkShop Visual Replay Command Syntax - Importing User-Defined Commands

#### Keywords

- import - load a module of additional commands
- user - invoke a command from a loaded module

#### Synopsis

        import module
        user command text

#### Inputs

- module - the name of the module
- command - the name of the command
- text - parameters passed to the command

#### Description

The command set of WorkShop Visual Replay is intended for replaying user actions and for checking the state of an application with respect to its widget hierarchy and its resource settings. There is nothing to stop you adding your own commands to meet your own needs. For example:

- To produce screen dumps at various points in a replay session.

- To do other sorts of consistency checking on the widget hierarchy - one example would be to interface with Doug Young's widgetlint library.

- To insert a probe or a patch for a particular debugging problem. This will be of most use in a stripped optimized binary, where you do not have access to the full power of the debugger.

import allows you to load a module of your own commands into a script. Once the module has been loaded the commands in it can be invoked using the user command. You can import as many modules as you wish.

#### Example

        import mymodule
        in ApplicationShell
    	cascade file_menu
    	    select fm_print
        in print_dialog
    	user myscreendumper print_dialog

#### Notes

The shell and setenv interface is the preferred route if the actions you need to perform do not involve extensive access to the widget hierarchy, or inspection of the internals of your program. In the latter case, see Adding Your Own WorkShop Visual Replay Commands.

See also:

- WorkShop Visual Replay Command Syntax