Using the Macro Recorder

Return to Introduction  Previous page  Next page

The TN3270 Plus macro recorder is designed to automate keystroke sequences. Use the macro recorder to record a sequence of keystrokes as you type them. Then replay the macro to have the same keystrokes typed for you by the macro recorder.

Here are some common uses for macros:

 

Logging on terminal emulation users.

 

Performing a series of commonly issued commands.

 

Normally you will start the macro recorder, perform a common sequence of keystrokes and stop the macro recorder. Once the macro is recorded it may be played anytime you require the same keystroke sequence.

The TN3270 Plus scripting language also provides the ability to automate common tasks. See the Macro Recorder and Scripting Language Comparison

for a discussion about which feature to use to automate your work.

Macro Syntax

A macro contains text and terminal key functions. Text appears in the macro with no punctuation. Keyboard function keys are represented by the function key name enclosed in a less than and greater than sign pair < keyname >. For example, the enter key appears in a macro as follows:

<Enter>

The complete list of keynames can be found in the Keyboard Map Setup dialog box. To display the Keyboard Map Setup dialog box, open the Setup menu and select Sessions..., from the Setup Items list box choose Keyboard and then click the Configure... button. Select Terminal Keys in the Function Group drop-down list box.

You may also consult the default keyboard maps in this help file:

 

Default 3270 Keyboard Map

Default 5250 Keyboard Map

Default VT100 Keyboard Map

 

Macro Recorder Tutorial

The following tutorial provides step-by-step instructions for recording the "sample" macro. The sample macro types the word "test" at the current cursor location and then "presses" the enter key. Connect a terminal emulation session, position the cursor to a data entry position and then follow the steps below.

 

Recording the Sample Macro

 

1.Open the Macros menu and select Start Recording.
2.Type "test" and press the enter key.
3.Open the Macros menu and select Stop Recording.
4.Enter the name "Sample" for the macro in the Save As dialog box.
5.Click the OK button.

 

Playing the Sample Macro

 

1.Return the session to the state it was in before you recorded the Sample macro.
2.Open the Macros menu and select Replay.
3.A second level menu listing of all recorded macros appears. Select the Sample macro.
4.The Sample macro runs. It should produce the same result as the keystrokes used to record the macro.

 

Editing the Sample Macro

 

1.Open the Macros menu and select Edit.
2.A second level menu listing of all recorded macros appears. Select the Sample macro.
3.The Macro Editor dialog box is displayed. The macro definition should contain the following:

 

test<Enter>

 

4.Click OK without making any changes. See the Macro Editor dialog box topic for information on editing a macro.

 

Assigning a Keyboard Shortcut to the Sample Macro

 

1.Open the Macros menu and select Assign Key.
2.A second level menu listing of all recorded macros appears. Select the Sample macro.
3.The Type Key dialog box prompts you for the keyboard shortcut. Hold down the shift and alt keys and press the letter a. Shift+Alt+A appears in the edit box.
4.If Shift+Alt+A does not appear in the edit box, click the Retry button and try again.
5.Once the Sample macro is assigned to Shift+Alt+A, click the OK button.
6.Return the session to the state is was in before you recorded the Sample macro.
7.Press Shift+Alt+A. The Sample macro runs.

 

Deleting the Sample Macro

 

1.Open the Macros menu and select Delete.
2.A second level menu listing of all recorded macros appears. Select the Sample macro.
3.The macro is deleted.

 

Pausing Macro Execution

It is possible to pause macro execution if the macro needs to wait for a host response before continuing. See the Macro Editor dialog box topic for more information.

 


TN3270 Plus is continually being improved. To learn more about the latest enhancements, please review our Version History web page.