Slick V3.3 manual Running a Recorded Macro, Saving and Editing Recorded Macros

Models: V3.3

1 568
Download 568 pages 2.03 Kb
Page 356
Image 356

Recorded Macro Operations

Note

The prefix key sequence Ctrl+Shift+F12 works in all emulations except SlickEdit text mode edi- tion. In that emulation, the prefix key sequence is Ctrl+Shift+T.

Each macro that you record and bind using this feature is saved to a new file named lastmac<key>.e, located in your configuration directory, where <key> matches the key you used when creating the binding (keys 0-9, A-Z, or F1-F12). These files can be helpful for determining what was recorded, because if you use this method to bind a recorded macro, you will not have an opportunity to name the macro or see a list of macros created with this method (they will not appear in the List Macros or Key Bindings dialogs).

Running a Recorded Macro

If you have saved the macro and created a key binding for it, the easiest way to run it is to simply press the associated key sequence. You can also run it by:

Typing the name of the macro in the SlickEdit® Core command line then pressing Enter.

Using the List Macros Dialog (Macro List Macros or list_macros command)—select the macro and click Run.

You can run the last macro that you recorded, whether it was saved or not, by clicking Macro Execute last-macro(Ctrl+F12 or execute_last_macro command).

Saving and Editing Recorded Macros

When a recorded macro is saved, the source code of the macro is appended to the vusrmacs.e user macros file located in your configuration directory.

To edit a macro that has previously been recorded and saved, from the main menu, click Macro List Macros (or use the list_macros command) to display the List Macros Dialog. The list box on the left dis- plays a list of your recorded macros. Select the macro you want to edit, then click Edit. The vusrmacs.e file opens in the editor. Save the file when you’re done making edits.

If you are using recorded macros to discover Slick-C®code (see Using Macros to Discover and Control Options), you can view/edit the source of a macro that you have just recorded but have not yet saved. After creating a new recorded macro, you are prompted with the Save Macro Dialog. Instead of naming the macro and saving it, click Edit (or press Alt+E) to view the source. A new editor window named lastmac.e, which is the name of the file that contains the source of the last macro that was recorded, is opened showing the macro’s source code. If you make edits, you will need to save the changes by click- ing Macro Save last-macro. The Save Macro dialog is displayed where you can name the macro and then click Save, which then appends the new code to the user macros file (vusrmacs.e). To bind the macro to a key, use the Key Bindings dialog, which is not automatically displayed like it is when record- ing/saving a macro in the normal way (see Binding Macros Using the Key Bindings Dialog).

Each macro recorded and bound using execute_last_macro_key is saved in a file named last- mac<key>.e, and the corresponding compiled byte code is saved in lastmac<key>.ex, where <key> matches the key you used when creating the binding (keys 0-9, A-Z, or F1-F12). Both files are located in

334

Page 356
Image 356
Slick V3.3 manual Running a Recorded Macro, Saving and Editing Recorded Macros