InfoCenter

Using the Macro Editor

The Macro Editor allows you to modify an existing macro or create new macros.

Overview
Tab descriptions
Saving a macro
Cancelling a macro
Code Editor: Editing the XML script
Importing a macro
Exporting a macro

Overview

Host On-Demand records macros using XML scripting. You do not need to know XML scripting to edit a macro using the Macro Editor. Instead, the Macro Editor creates and modifies the script for you based on your input.

Users can edit any macro, including those in server macro libraries. However, they can only save them to writable locations, which include the Host On-Demand session or a personal macro library on the local drive.

After recording a macro, not only can you make changes to host screen definitions but you can use the Macro Editor to further customize and fine-tune it. For example, you might decide that the descriptors used to identify a screen when the macro was recorded were too general for your environment (too many other screens fit the same descriptors). You can add new descriptors or modify the existing ones. When recording with the Macro Manager, the macro is recorded in a single, sequential format. Using the macro editor, you can expand the macro to add looping for repeating screens and conditional logic to handle multiple screen paths in a host application.

When you record and play a macro, it is not a fixed sequence of screens and actions. Rather, for each screen that is displayed, the macro program searches defined screens until it recognizes the screen. It identifies the screen based on the descriptors defined for each screen (by default, the Macro Manager uses the number of fields and input fields on the screen). Once a screen is identified, it performs the actions defined for that screen. It then repeats these steps for each new screen it recognizes.

When you edit macros that were recorded using Host On-Demand V3 in the Macro Manager or Macro Editor, it is converted to the XML format and cannot be converted back to the V3 format.

Tab descriptions

The Macro Editor separates a macro into four elements. Each tab represents an element:

Macro
Contains general information about the macro.
Screens
Contains all the screens defined in the macro and all descriptors and actions that are defined inside each screen.
Links
Defines the ordering of the screens.
Variables
Defines the macro variables.

Saving a macro

Use the Save and Save As buttons to save macros. Clicking Save saves the macro to the location from which you opened it and closes the Macro Editor. Because server macro libraries are read-only, the Save option is disabled when editing macros that reside in the server macro library.

Clicking Save As allows you to save the macro to a location that is different than the current one. If you wish to edit a macro that is in your server macro library, you can use the Save As option to save it to your current session or to your personal library.

Cancelling a macro

Clicking Cancel discards all changes made since opening or saving the macro, not just the changes made on the current tab of the Macro Editor.

Code Editor: Editing the XML script

Click Code Editor to edit the macro directly. The XML script for the current macro is displayed. Make any necessary changes to the code and click Save. The macro code is saved and the Macro Editor interface is updated. If errors are found, they are listed in the Messages section at the bottom of the window. Fix any problems before saving the macro. Click Cancel to return to the Macro Editor without saving any changes.

Importing a macro

Click Import to import a copy of a Host On-Demand macro from the local file system into the Macro Manager. Before the import occurs, Host On-Demand prompts you to save any changes you have made to the current macro. The imported macro then becomes the current macro in the Macro Editor.

You can modify and save the imported macro. Clicking the Save button saves the macro in the current session. Clicking the Save As button allows you to save the macro to your personal library.

Exporting a macro

Click Export to save the macro as a file on the local drive. You can then use the new file in other sessions or share it with other users.

Related topics

  • Using the Macro Manager
  • Macro Programming Guide