Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Keyboard macros provide a way to record and replay keyboard sequences. Keyboard macros are distinct from scripting and UI event replay. For a scripting solution for Eclipse, please see the Eclipse Advanced Scripting Environment (EASE), and for UI event replay see SWTBot.
The plugin is currently hosted in the E4 incubator and the latest snapshot is available from the p2 repository at:
The implementation is specific to the Eclipse 4.x stream and has only been tested with Eclipse 4.7 (Oxygen).
A macro is recorded by using the record button in the toolbar and replayed using the playback button (alternatively, bind the commands 'Toggle Macro Record' and 'Playback Last Macro' to some keybinding in the Keys preferences page).
Macro recording is only available for the editor which was active when record started -- likewise, it is only replayed to the editor active when playback was initialized.
All keyboard input in the editor is recorded, although if the key combination activates an Eclipse Command, the command is recorded instead.
- Action for toggle record and playback last macro (added to toolbar).
- Record and playback Eclipse Commands triggered in the KeyBindingDispatcher.
- Record and playback keystrokes in the text editor.
- Persist and load the last recorded macro to/from disk.
- Other plugins may participate in the record/playback (through the org.eclipse.e4.core.macros.macroStateListeners extension point).
- Clients may skip the recording of eclipse commands through the org.eclipse.e4.core.macros.commandHandling extension point.
- Visual feedback on what's being recorded done through the status bar.
- Notify that the recording is not working if the user changes to another editor or tries to use the find dialog.
Macros only target the current editor, so, if some action would require interacting with another widget (such as a dialog or pop up), such interaction will not be recorded and the command may not be recorded at all if the result of the command opens a different editor.
No mouse interaction is recorded, although if the mouse interaction results in some eclipse command, that command will be recorded (provided that the current editor doesn't change).
Dialogs and pop ups
No dialog/pop up interaction is recorded, although if the interaction results in some eclipse command, that command will be recorded (provided that the current editor doesn't change).
Currently using the find dialog will not work (as any other dialog) -- as actions in the find dialog don't generate eclipse commands, users should use the Incremental Find (Ctrl+J) and Find Next (Ctrl+K) commands instead.
Code completion is disabled in the editor where the macro record/playback takes place.
- Make dialogs aware of the macro record mode (for instance, the for the find dialog to have actions that can be replayed, either it needs to issue Eclipse commands, provide callbacks for listener to record commands or be macro aware itself, likewise, applying a code-completion could simply save the result of applying the code-completion in the macro).
- Persist macros under a given name and playback such macros.
- Replay a macro X times (or until the end of the file is reached).
- Edit a saved macro.
Contributing Fixes and Improvements
The source is available at:
in the master branch as
bundles/org.eclipse.e4.core.macros bundles/org.eclipse.e4.ui.macros bundles/org.eclipse.ui.workbench.texteditor.macros tests/org.eclipse.e4.ui.macros.tests features/org.eclipse.e4.ui.macros.feature
Please submit bugs via Bugzilla against e4/UI with "[macros]" in the description (link).
Please direct questions to the e4-dev mailing list.