Creating and Using
Macros
You can record macros in the IDE to reduce what
would normally involve a long set of keystrokes to one keyboard
shortcut. In macros, you can combine the typing of
characters
in
the Source Editor and the typing of other keyboard shortcuts.
To record a macro:
-
Put the insertion point in the part of a file in
the Source Editor where you want to record the macro.
-
Click the
button
in the Source Editor's toolbar (or press Ctrl-J and then type
s
) to begin recording.
-
Record the macro using any sequence of
keystrokes, whether it is the typing of characters or using
keyboard shortcuts. Mouse movements and clicks (such as menu
selections) are not recorded.
-
Click the
in the
Source Editor's toolbar (or press Ctrl-J and then type
e
)
to finish recording.
-
In the Macro field of the Recorded Macro dialog
box that appears, fine-tune the macro, if necessary.
-
Click Add to assign a keyboard shortcut to the
macro.
-
In the Add Keybinding dialog box, press the keys
that you want to use for the keyboard shortcut. (For example, if
you want the shortcut Alt-Shift-Z, press the Alt, Shift, and Z
keys.) If you press a wrong key, click the Clear button to start
over.
Be careful not to use a shortcut that is already
assigned. If the shortcut you enter is an editor shortcut, a
warning appears in the dialog box. However, if the key combination
is a shortcut that applies outside of the Source Editor, you will
not be
warned
.
You can assign a new shortcut in the Options
window. Choose Tools Options, click the Editor panel, select the
Macros tab, and then click the Set Shortcut button.
|