Advanced HATS Macros
Work with macros in HATS
Use the advanced macro editor to...
- Add actions, such as new prompts, mouse clicks, or conditional actions
- Edit and enhance the macro's screen recognition behavior and user input
- Add more intelligent behavior to the macro, such as choosing between alternate paths through an application
You can work with macros in several different ways within HATS Studio:
- You can record macros in HATS Studio using the host terminal. After you have recorded a macro, it will be listed in the HATS Project View, in the Macros folder.
- To edit a macro, double-click the macro name in the HATS Project View to open the HATS macro editor. The tabs on the bottom of this editor enable you to work with the macro in different ways, including editing the XML source of the macro in the source view.
- You might want to perform advanced editing on a macro, to add actions or make other changes described above. On the Overview page of the HATS macro editor, click Advanced Editor... to work with a macro using the advanced macro editor.
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.
- In HATS Studio, select...
YourHATSproject | host terminal- Record a simple macro to use as a holder for the script:
Record Macro | Stop Macro | Save Macro- Edit the macro that you just recorded.
- Select...
HATS Project View | Macros folder | MacroName (double-click) | Source tab- In the source view, delete the lines beginning with <HAScript> and ending with </HAScript>.
- Copy the entire text of a macro script from this document to the system clipboard, using whichever method you are accustomed to.
- Paste the macro script into the source view.
- 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