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

Z and I Emulator for Web 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. If the user does not have write-access to the location where the macros is, they can save the updated macro to an alternate location.

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.

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 Exit, Save As, and Save buttons to save macros.

  • Clicking Save and Exit saves the macro to the location from which you opened it and closes the Macro Editor. Because an internet server library location is read-only, the Save option will not be available when editing a macro in that location.
  • 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 internet server macro library or any other location for which you do not have write-access, you can use the Save As option to save it it to an alternate location.
  • Clicking Save has the same result as clicking Save and Exit, except that clicking Save does not close the Macro Editor.

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 open the Code Editor window.

The Code Editor window contains a text editing area that displays the XML script for the current macro and allows you to make changes directly to the XML commands in the script. All the XML commands in a macro script are commands belonging to Z and I Emulator for Web's XML-based macro language. For more information on this macro language, see Using the Macro Editor.

Make any changes you require. Then click OK, Verify, or Cancel:

  • OK Click OK to save the XML script, including your changes, and to close the Code Editor window. When you click OK:
    1. Z and I Emulator for Web checks the XML script for validity, including any changes that you have made to the script.
    2. If Z and I Emulator for Web finds an error in the XML script, then Z and I Emulator for Web continues to display the Code Editor window and writes an informative error message into the Messages area at the bottom of the Code Editor window.
    3. If Z and I Emulator for Web does not find an error, then Z and I Emulator for Web saves the XML script and closes the Code Editor window.
  • Verify Click Verify to check the XML script for errors without closing the Code Editor. When you click Verify:
    1. Z and I Emulator for Web checks the XML script for validity, including any changes that you have made to the script. This check is the same as the check that Z and I Emulator for Web does when you click OK.
    2. If Z and I Emulator for Web finds an error in the XML script, then Z and I Emulator for Web writes an informative error message into the Messages area at the bottom of the Code Editor window.
    3. If Z and I Emulator for Web does not find an error, then Z and I Emulator for Web clears the Messages area.
    4. Z and I Emulator for Web does not close the Code Editor window.
  • Cancel Click Cancel to discard any changes and to close the Code Editor window. When you click Cancel:
    1. Z and I Emulator for Web discards any changes that you have made to the XML script.
    2. Z and I Emulator for Web closes the Code Editor window.

Importing a macro

Click Import to import a copy of a Z and I Emulator for Web macro from the local file system into the Macro Manager. Before the import occurs, Z and I Emulator for Web 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 an alternate location.

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