The QGIS Macro Plugin extends QGIS development tools with a macro panel that allows users to record and playback simple macros.
- Record and playback macros (mouse and keyboard events)
- Save macros to disk for later usage
- Optionally profile macros
Install the plugin from the QGIS plugin repository or download the zip from the repository releases.
- Download the latest release ZIP from the GitHub releases
- In QGIS, go to Plugins > Manage and Install Plugins...
- Select Install from ZIP and choose the downloaded file
Open QGIS Development Tools and interact with the Macro tab.
Click the Record button in the macro panel, then interact with QGIS normally (click, type, navigate, etc.). The macro records your mouse and keyboard events. Click Record again to stop and name the macro.
Select a saved macro from the table and click the Play button to replay the recorded events.
Click the Save button to export macros as a .json file.
Use the Open button to load previously saved macros from disk.
The core library (qgis_macros) can be used independently of the plugin.
See the API documentation
for details.
from qgis_macros.macro import Macro
from qgis_macros.macro_player import MacroPlayer
from qgis_macros.macro_recorder import MacroRecorder
# Record a macro
recorder = MacroRecorder()
recorder.start_recording()
# ... user interactions ...
macro = recorder.stop_recording()
# Play it back
player = MacroPlayer(playback_speed=1.5)
player.play(macro)- QGIS version 3.34 or higher (including QGIS 4).
- Python 3.12 or higher.
Full documentation is available at macro-qgis-plugin.readthedocs.io.
Contributions are welcome! Feel free to open issues or submit pull requests.
See development readme for details.
These awesome plugins are used as an inspiration for the plugin structure:
- https://github.com/Joonalai/profiler-qgis-plugin
- Initially this plugin was part of profiler-qgis-plugin
- https://github.com/nlsfi/pickLayer
- https://github.com/nlsfi/segment-reshape-qgis-plugin
- https://github.com/GispoCoding/pytest-qgis
Licensed under GNU GPL v3.0.
Copyright (C) 2025-2026 macro-qgis-plugin contributors.
