Skip to content

Macro Menu (Reflection)

Reflection for HP supports Visual Basic for Applications macros as well as two older programming languages (Reflection Basic and RCL). It does not support the .NET API.

You can create macros using the macro recorder or by using the Visual Basic Editor. Once you have created macros, you can run them using the Macros command on the Macro menu, or you can configure events, hotspots, mouse clicks, or toolbar buttons to run macros.


Macros Dialog Box (Reflection)

Getting there

Reflection for Secure IT > Macro > Macros

Reflection provides macro support using Visual Basic. When you record macros in Reflection or create new macros using the Create button in the Macros dialog box, they are placed in a module called NewMacros. Macros are saved in your Reflection for HP settings file (*.r1w).

In writing and editing Reflection macros using Visual Basic projects you will be working with:

Visual Basic features that are common to all Visual Basic applications. These features include the Visual Basic Editor, Basic language programming commands that are common to all Visual Basic implementations.

Methods, properties and events that are specific to Reflection for HP sessions and allow you to configure and manipulate these sessions.

Context-sensitive help from the Visual Basic Editor for Reflection for HP commands is provided by an installed Windows Help file. On newer Windows system, support for viewing Windows help (*.hlp) is no longer available by default. See Technical Note 2294 for information about how to configure this support.

The Programming Reference information is also available on the support website here: http://docs.attachmate.com/reflection/14.x/prog-ref/hp-unix-openvms/.

Macro data Use this field to pass information to the macro. Within a macro, use the MacroData property to access this value.
Export Export the selected macro to a macro file.

Macro Files

Macro files are plain text files that provide a way to save simple macros independently of Reflection settings files (*.r1w). Each macro file contains exactly one macro. Macros are limited to a single subroutine; and cannot call other routines or user forms.

Any recorded macro will run successfully as a macro file because all the code in any recorded macro is contained within a single subroutine. However, if you have created another macro (MacroB) that includes a call to your recorded macro (MacroA), MacroB will not run correctly after being exported to a macro file because the code in MacroA is not included in the exported file.

You can create a macro file when you save a recorded macro by setting Destination to Macro File. You can export an existing macro to a macro file using the Macros dialog box Export option.


Recording Macros

Getting there

Terminal > Macros > Connection Setup > Start Recording | Stop Recording

The macro recorder allows you to capture actions you perform in Reflection for HP. For example, to create a login macro, you can turn on the macro recorder, log on to a host, then stop recording.

Stop Recording Dialog Box Options

Destination You can save recorded commands as a Visual Basic Macro, a Macro File, or as text to the Clipboard.

When you select Macro (the default), the recorded macro is not saved until you save your Reflection for HP settings.
Create a button Creates a new toolbar button that will run the macro you are recording.
Make this the connect macro Connect macros run immediately after Reflection has successfully made a connection to the host. The name of the connect macro for a Reflection for HP session can be viewed and edited from the Connection Setup dialog box.