The [macroRef] command.

Introduction

The macroRef command lets you record sequences of actions which you can replay later. This is useful to automate some repetitive tasks. The following kinds of actions can be recorded: Key strokes which do not correspond to a key binding are not recorded.

Synopsis

The formal syntax of the [macroRef] command is:
macroRef subcommand ?options?
The possible subcommands are described below. Depending on the subcommand, some options may be specified.

MacroRef subcommands

The [delete] subcommand

This subcommand deletes a macro sequence designated by its token. The complete syntax is:
    macroRef delete token
Note that you can't delete a macro while it is being recorded: you must first stop the recording, then delete it. Once a macro sequence has been deleted, its token is no longer valid.

The [execute] subcommand

This subcommand replays a recorded sequence of actions. The complete syntax is:
    macroRef execute token
If any command in the sequence fails (i-e raises an error) then the execution of the sequence is aborted and the remaining commands are not executed.
Note that you can't execute a macro while it is being recorded: you must first stop the recording, then execute it.

The [isRecording] subcommand

This subcommand tells whether a sequence is currently being recorded. The syntax is:
    macroRef isRecording

The [list] subcommand

This subcommand returns a list of the valid sequence tokens. The syntax is:
    macroRef list
The list returned is in reverse creation order: last created sequence comes first.

The [script] subcommand

This subcommand returns a list of the recorded actions for the given sequence. The complete syntax is:
    macroRef script token
The returned value is a list of Tcl instructions corresponding to the recorded actions. If recording is still going on, this command returns a list of the commands recorded so far.

The [startRecording] subcommand

This subcommand starts a new sequence of actions. The syntax is:
    macroRef startRecording
The command returns a token which can be used with the other subcommands.

The [stopRecording] subcommand

This subcommand stops the recording. The syntax is:
    macroRef stopRecording
If no sequence is being recorded, the command is just ignored.

Last updated 2016-11-23 15:54:16