Running the macro, of course, is where you see whether the recording process translates into something useful. Note Don't be surprised if it doesn't run correctly the first time. If there are errors, see Opening and Editing Macros on page 974. You can also insert breakpoints during macros, which stop the process at certain points. These are useful because you can examine the results of a particular step, then continue playing the macro, or play it one step at a time. See Using Breakpoints to Stop Macros at a Specified Point on page 974. Use any of the following procedures to run the macro. Assigning a Shortcut Key to a MacroIf you'll be running the macro several times and it's not connected to a button or other element yet, it's a good idea to set up a shortcut to it, using the Configuration window. (For more information about setting up shortcut keys, see Assigning Shortcut Keys to Menu Items on page 104.)
Running a Macro From Start to FinishYou can run a macro in the IDE or in the application where the macro will run, if the necessary conditions to start the macro are available. For instance, if the first step to run the macro is making a selection from the File menu, you can run the macro from anywhere . If the first step is in a Writer document, it must be open and be the active document. You can quickly run a macro using any of the following methods . Running the First Macro in a ModuleThis works only if a macro is open in the IDE window (the icon will be dimmed if no macros are open). It will run only the first macro in the current module; only one module and library can be open at a time.
Running a Selected Macro
Running a Macro One Step at a TimeUnfortunately, there is no debugging program for macros. However, you can run the script one step at a time to see what happens at each step.
Using Breakpoints to Stop Macros at a Specified PointYou can add a breakpoint that stops the macro on the line you select. You can then run the macro manually step by step using the Single Step icons (see Running a Macro One Step at a Time). Note When you insert the breakpoint, the program checks the entire macro for errors; you can't insert one if there are any problems anywhere in the code. You might need to comment out problem lines before you can add the breakpoint.
|