Advanced HATS Macros

 

+
Search Tips   |   Advanced Search

 

Work with macros in HATS

Use the advanced macro editor to...

You can work with macros in several different ways within HATS Studio:

The advanced macro editor is not synchronized with the HATS macro editor. This means that when you make a change in the advanced macro editor, it will not be reflected immediately in, for example, the source view. When you save and exit one editor, the changes will be reflected in the other.

The advanced macro editor is a graphical user interface (with buttons, input fields, list boxes, and so on) for editing the parts of a macro. Figure 1 shows the advanced macro editor.

 

Definitions of terms

action Instruction that specifies some activity that the macro runtime is to perform when it plays back the macro (such as sending a sequence of keys to the host, displaying a prompt in a popup window, capturing a block of text from the screen, and other actions). You can edit or create actions in the advanced macro editor. You can view and modify individual action elements in the source view.

An action within a macro is not the same thing as an action triggered by a HATS event.

application screen Meaningful arrangement of characters displayed on the host terminal by a host application.
descriptor Instruction that describes one characteristic of an application screen. Descriptors are also called screen recognition criteria. You can edit or create descriptors in the Macro Editor.
host terminal A connection in HATS Studio to the host application where you record and run macros.
macro runtime Program module that plays back a macro when a the macro is started. Specifically, the macro runtime reads the contents of the current macro script and generates the macro playback.
macro screen Set of instructions that tells the macro runtime how to manage a particular visit to a particular application screen.
macro script XML script in which a macro is stored. You can edit a macro script directly using the source view or indirectly using the advanced macro editor. When you play a macro, the macro runtime executes the instructions in the script.
source view Shows the XML source of a macro. To use it, open the HATS macro editor (not the advanced macro editor described in this book) by double-clicking the name of a macro in the HATS Project View. Click the Source tab to open the source view and work with the XML source of the macro.
valid next screen Macro screen that, during macro playback, is a valid candidate to be the next macro screen to be processed.

 

Samples

You can create a new macro by copying a macro script from this document. This section assumes that you are copying an entire macro script, beginning with <HAScript> and ending with </HAScript>. Follow these steps.

  1. In HATS Studio, select...

    YourHATSproject | host terminal

  2. Record a simple macro to use as a holder for the script:

    Record Macro | Stop Macro | Save Macro

  3. Edit the macro that you just recorded.

    1. Select...

      HATS Project View | Macros folder | MacroName (double-click) | Source tab

    2. In the source view, delete the lines beginning with <HAScript> and ending with </HAScript>.

    3. Copy the entire text of a macro script from this document to the system clipboard, using whichever method you are accustomed to.

    4. Paste the macro script into the source view.

    5. Click File > Save (or use Ctrl-S) to save the macro script.

You can edit the macro further using the source view, the host terminal, or the advanced macro editor.

 

Home