Recording macros
Usually, you will first try to record what you want to automate to
refine the recorded macro later.
- Start the target program(s) you want to automate and create a
situation that looks similar to the one when the macro will be
started (open files etc). Maximize your windows if possible and
move them to your primary screen if you want to record mouse
events.
- Close all programs you do not need for the macro (or at least
save your changes. You won't be the first whose macro accidentally
destroys some other important documents that are still open).
- Test the actions you want to perform at least twice and notice
possible problems. Try to find keyboard alternatives for mouse
commands.
- Start IntelliMacro (if not done already) and select File|New.
- Configure recording options:
- Record delays
- Save times of delays between events. The macro will run in the
same speed as when it was recorded. You can use
the DelayMult command to speed up the macro later.
- Mouse recording
- Save mouse events. You have several options here to select the
base coordinate system or to include movements (i. e. when no
mouse button is pressed). If you do not include movements,
movement between clicks is performed immediately before the next
click. Absolute should be used if the program runs
full-screen or is located at a fixed position on the (primary)
screen. For windows that appear at different positions, you can
either use one of the Relative options, or resize the
window at startup using the SetPosition command. In the
latter case, write the SetPosition command, run the macro once,
and start recording afterwards. The last two Relative
options (to window, to control) are only needed in special cases and
usually cause more confusion than they solve. If possible, avoid
mouse events completely.
- Record window switches
- Save when the foreground window (including MDI windows) is
switched. IntelliMacro will wait for that window at playback and
focus it once it is there. This usually makes macros that work
with lots of dialogs more stable. Sometimes it is hard to
determine whether a window switch happened before or after an
event; in that case the macro needs to be edited later. You will
also have to edit the macro if the window title of the program (or
MDI window) is dynamic (e. g. includes the document name). In that
case, replace the dynamic part by * in the resulting
macro.
- Record Screenreader events
- Not used yet.
- Move to tray
- Move IntelliMacro to tray while recording the macro instead of
minimizing it. You can click the Tray Icon to stop recording if
mouse recording is disabled. This option is useful if your macro
or the target application depends on the number of open
windows.
- Select Macro/Record (Append) or Macro/Record New
- Perform the actions you want to automate. Prefer keyboard
actions to mouse actions wherever possible as those are more
stable. If you accidentally press the wrong key, you can remove
them from the macro later, or you can stop recording, remove them,
and continue recording.
- To stop recording, press the [Break] key on your
keyboard. Alternatively click the minimized IntelliMacro window, if
mouse recording is disabled.
- Now you can save edit or run your macro.
When recording longer macros:
- Record the macro in parts.
- Add comments after each part, starting with a hash sign and a space:
# This is a comment
- Save the macro between parts
When recording the macro, bear in mind that a macro has certain
limitations:
- It cannot react to unforeseen events.
- It cannot base its actions based on what is on the screen. Or at
least only in a very limited way.
- It cannot run in the background. On a Windows system, there is
only one mouse pointer (even if you have multiple "window stations"
available, like with WinXP Fast User Switching), so whenever you try
to switch window station, the macro will fail because the mouse
pointer is away. The same happens if you try to lock your screen while a
macro is running.
The macro recorder will record the following commands (for more
details, see the predefined command reference):
- Keyboard actions (Down, Up, DownUp)
(Common problems: "stuck" keys, wrong foreground window)
- Mouse actions (Mouse, MouseRel,
MouseRelWindow, MouseRelControl, Wheel)
(Common problems: multiple screens, moved windows, multi-line
menu/tool bar, unfold direction of menus)
- Delays (Delay) (can be added later as well, often
needed when a dialog window opens)
- Window Switches (Window)