HOWTO: Open Document in WordPad

A macro is a set of instructions recorded in the computer to automate repetitive tasks. A macro may be for keystrokes, mouse clicks, or complex functions. A macro for keystrokes or mouse clicks simulates the human operator hitting keys or clicking menu items or buttons. Macro activation may occur with keyboard, mouse, or other input, such as programmable keypad or voice commands.

Keystroke activation can be accomplished by using a special key such as Alt or Ctrl and the underlined letter in the name of a button or menu item.  When activated, this will have the same effect as a mouse click on that button or menu item.  Macros can be written simulating mouse clicks too.  Consequently, the user can select between activation by keyboard commands or mouse clicks in creating macros, but keyboard commands are generally more reliable and should be used where possible.

MacroBLASTER receives numeric keycode messages which tell it which macro to activate.  MacroBLASTER then sends the appropriate macro to the target software. The macro activated depends upon the key selected and the macro assigned to that key in that layout. In different layouts, the same key could activate different macros.  Consequently, it is possible to create a large number of macros that can be used with a single, for example, 20-key keypad.

You can also use MacroBLASTER with speech recognition or bar code to activate any of the simple or complex macros that you develop. With MacroBLASTER, you can create a virtual keypad that is activated by a variety of input devices. Within this virtual keypad, you can create up to 18 rows and 18 columns of virtual buttons. You can also have a single layout that has some key positions activated by physical keys and others activated by virtual keys.

Using the macro technique requires the user to install the target software and develop macros that activate the desired function in that software.   To assist in this task, Custom Speech USA, Inc. has developed a suite of macro tools. Script Tool for Command! is designed for use with the Command! workflow and document manager. Script Tool for MacroBLASTER is designed for creating macros activated by programmable keypad or other input. Script Tool for PlayBax is limited to macro generation for conversion of audio formats.  

The following is an outline of how to create a macro "Open Document" for  WordPad. This is followed by a method for voice activation using Dragon NaturallySpeaking.

Preliminary--Create Document and Review Functions Performed by the Macro

Create a short document using WordPad (WordPad can be found in Start, Programs, Accessories) and save it as C:\…\My Documents\test Doc.doc, then close WordPad. (In Windows 95\98\ME, My Documents will usually be found in the root directory of C:\. In Windows NT, look at C:\winnt\profiles\<userid>\. In Windows 2000 refer to C:\Documents and Settings\<userid>\. If these paths have been changed, consult your system administrator.)

These are the functions that will be performed by the macro:

1. Open WordPad.

Click on File and highlight Open.

Click on Open. This window opens:

When the window opens, the cursor is in the File name text box. Enter the file name (not shown). Press Enter to open the document file.

To create the macro "Open Document", follow these steps.

Step 1. Enter Identifying Information for WordPad

1. Click on Configure, then Configure Layout.

2. This opens the Configure Layout window.

Then click on Configure, Configure Software. The Script Tool window appears:

3. Click on the Add New button. Script Tool will clear (if required) the input area of the Configure Software Script frame.

Enter the application name, the action name, and a brief description of the macro function in Configure Software Script frame. Note that the action name will be the common name by which the macro will be known.

4. Identify the application to MacroBLASTER. This is a two-part operation.

a. Use the three-dot browse button to open a browse window. Find and highlight the executable file name for WordPad. Click on the Open button or double click on the WordPad executable file to enter it into the Executable Name text box.

(Windows 95/98/ME could refer to WordPad.exe in C:\Program Files\Accessories\ or may refer to WordPad as WRITE.EXE in the C:\Windows\ folder. Windows NT/2000/XP:  WordPad.EXE in C:\Program Files\Winnt\Accessories\). Right click on the WordPad shortcut in Start, Programs, Accessories, and then click on the properties menu item. The file in the Target Window is the executable file.

b. MacroBLASTER uses the window title and class to identify applications. The magnifying glass will extract this information from the appropriate window and insert it into the correct fields.

To use this tool, open WordPad while Script Tool is running. Click and drag the magnifying glass graphic over the WordPad title bar and un-click. Script Tool will copy the correct information into the appropriate fields. Note that the macro name "Open Document" is used for the Action Name.

The window title often will contain information that could change, such as a file name. In this case, WordPad inserts the generic name "Document." It must be modified by replacing anything that could change with the wildcard character, *. Likewise, modify the window class if it contains any changeable information. In this case, no modification is required.

Step 2. Writing the Script.

1. Position cursor in editor window. Left clicking anywhere between the keywords Sub Main and End Sub will position the cursor, ready to enter macro instructions.

2. Identify the main Script Tool menu bar.

3. Select Keyboard, Send Keystrokes.

This will send "ck.DoSendKeys "text"" to the script editor. The function of this instruction in a macro is to send the keystrokes within the quotation marks just as if they were input from the keyboard.

4. The text between the quotes can be replaced with any keyboard input or with any special keys selected from the menu. In this case, we wish to send the Alt key. Use the Send Keystrokes, Key Modifier, Alt. This will insert the special symbol for Alt, which is, "%". (You may input "%" symbol directly from the keyboard.)

5. With the cursor in place, input the "fo" directly from the keyboard.

The executed macro instructions will send the keyboard shortcut to open the Open window, with the cursor positioned in the File name window, ready to accept input of the file name.

6. The ck.DoSendKeys instruction will insert the file name, c:\My Documents\test Doc.doc. Click on Keyboard, Send Keystrokes. Enter the file name in place of text between quotation marks.

7. Now send the Enter. This is a two-step process. First, click on Keyboard, Send Keystrokes. Second, click on  Keyboard, Special Keys, Enter (pictured below).

This replaces text with Enter.

This is the final step. The same techniques can be used to automate more complex procedures.

Voice Activation

To voice activate "Open Document," create a layout, then voice enable. As an example, we are using Dragon NaturallySpeaking.  For additional information on creating a layout, see New Layout and Create New Layout under Configure Layout.

Step 1. Create a Layout:

1. Open MacroBLASTER.

2. Click on Configure in the main menu, then Configure Layout.  The Configure Layout window will appear.

3. Then select File, New Layout.  The Create New Layout window will appear.

4. Using the Rows and Columns fields, assign the number of keys. While there are up to 18 rows and 18 columns per layout, the illustration uses a single column and row.

5. Click OK and then enter the name of the layout, Open Doc Test.

6. Click Save:

7. Click the "+" in front of the application name WordPad. Click and drag the Open Document action name to the one button in the layout. Release the mouse:

8. Click OK and the layout file is loaded.

The Open Document macro has been created. The macro action has been assigned to a single key in the Open Doc Test layout.

Step 2. Create 3 Digit Command Key Sequence For the Voice Macro to Execute:

1. Open Execute Button window. Click Enabled and Execute Button. The program should be in the Running mode.

The Enter Keycode window will appear.

2. Enter three digits to activate the appropriate key in the layout. As an example, after loading Open Doc Test layout, enter 001. This will cause the macro to execute. (The keys are numbered, beginning with the upper left hand corner, 001,002,..., consecutively left to right, row by row.)

Step 3. Create Voice Command that Activates the 3 Digit Command Key Sequence:

1. Using Dragon NaturallySpeaking, create an "application specific Custom Command" called "open test document" directed to MacroBLASTER. (For instructions on using Dragon NaturallySpeaking, consult the Dragon documentation or vendor.)

2.  Using the Custom Command, send the following Keystrokes {Alt}+ER {Alt}+EX001. If MacroBLASTER is running, the voice command "open test document" will send the 3 digits to the key and cause MacroBLASTER to activate the Open Document macro.  This will open the document in WordPad.

In effect, you have created a macro that activates a macro.  That is, a voice macro that activates a complex keyboard macro.

As users of voice commands will recognize, the voice macro "open test document" could have different wording.