3.3 CASL Macros

A macro is a series of instructions for performing specified tasks. These instructions are written using the Common Accessory Script Language (CASL).

Using macros, you can do any of the following:

  • Perform keystroke sequences.

  • Run another PC application.

  • Perform almost any function that can be performed using the Accessory Manager menus, such as loading a QuickPad.

  • Create dialog boxes so that you can request user input.

You can also use macros to perform traditional programming tasks, such as the following:

  • Manage variables and constants.

  • Manipulate or set date and time values.

  • Perform mathematical calculations.

  • Manipulate strings.

Creating a CASL Macro

You can create a CASL macro in two ways:

  • Perform the actions that you want to include in the macro, and Accessory Manager records those actions in a CASL macro file, which you can then edit if needed.

  • Open the CASL Macro Editor and write the macro using the CASL script language.

Running a CASL Macro

Once you have create a CASL macro, you can run it at any of the following times:

  • When you start Accessory Manager (application start-up macro).

  • When you open a session (session start-up macro).

  • When you click CASL Macro from the Tools menu, click the desired macro, and click Run.

  • When you click a toolbar or QuickPad button, press a key, or double-click a HotSpot that has been configured to run a macro.

  • When the mouse button double-click has been configured to run a macro with the same name as the word under the mouse pointer.

  • When you click Run from the CASL Macro Editor Macro menu.

To create a CASL macro using Learn Mode

  1. If a session is not already open, open one.

  2. From the Tools menu, click Learn CASL Macro.

    The CASL Macro Editor starts in a minimized state.

  3. Perform the tasks that you want to include in the macro.

  4. When you have finished, click Stop CASL Learn from the Tools menu.

  5. When you are prompted about saving the CASL macro, select to either Save the CASL macro, or discord the macro without saving it.

    NOTE:If you need to edit the CASL macro, you can do so using the CASL Macro Editor.

To run a CASL macro from a session window

  1. If a session is not already open, open one.

  2. From the Tools menu, click CASL Macro.

  3. Do one of the following:

    • From the Macro Name list box, double-click the .XWC file to run.

      -or-

    • Click the macro to run, then click Run.

In this section