Skip to content
ispyisail edited this page Oct 9, 2026 · 5 revisions

Macro recorder

Do a task once by hand in QElectroTech, with recording on. Then hand the recording to an AI assistant, which turns it into a general, tested script button β€” "rotate the selected coils half a turn" rather than "rotate KA1 and KA2".

Status: merged on 2 October 2026. Everything on this page is in development builds made since then; it is not in a release yet. The pull requests:

PR What it adds Builds on
#1227 recording in QElectroTech: start, stop, the files, the status bar, the request to paste #1223
#1228 the qet_recording_* MCP tools #1225

Both sit at the end of the script buttons series.

Not the same "macros" as templates. QElectroTech's templates β€” reusable blocks of symbols β€” live in a folder called macros. The macro recorder has nothing to do with them: it records what you do, and its result is a script.

Menu and option names are given in French, as QElectroTech shows them until the translations are updated, with an English gloss in italics.


Why a recording, and not a replay

Describing a drawing task in words to an assistant is slow and easy to get wrong. Showing it is quicker. But replaying your mouse clicks would break as soon as anything on the sheet moved, so the recorder does not keep clicks. It keeps what changed, step by step, and the whole project before and after. The assistant writes a script from that, and checks the script reproduces exactly the change you made.

QElectroTech cannot send anything to an assistant itself: the assistant asks, QElectroTech answers. So the recording is saved where the assistant's MCP server can read it, and you hand it over with one paste.


Recording

  1. Open the project and select what the task starts from (the selection is recorded too).
  2. Project > Scripts > Record a macro. It is also a command in command search (Ctrl+Shift+M) and on the S shortcut bar if you add it.
  3. Do the task. The status bar shows ● Recording: N steps (Recording: N steps) with an Stop button.
  4. Stop: Stop, or the same menu entry, which is ticked while recording.

The status bar while recording: a red dot, 'Recording: 2 steps', and the Stop button

A box, Macro recorded, gives the recording's name (Macro of 02/10/2026 14:30), its number of steps and its folder:

Button Does
Copy the request for the assistant copies a ready-made request to paste into the assistant's chat
Open the folder opens the recording's folder
Close closes the box; the recording stays saved

The Macro recorded box: the recording's name and step count, the folder it was saved in, and the buttons Open the folder, Close and Copy the request for the assistant

Recording needs no setting: it only writes files. Turning it into a script does β€” see below.

What counts as a step

Every entry the task adds to the undo history (Undo, Undo panel) is one step: its name as the Undo panel shows it, which sheet, what was selected after it, and the sheet as it was after it. Because steps come from the undo history, any command QElectroTech has is recorded with nothing to teach the recorder.

  • An undo during the recording is recorded as a step too.
  • Several moves of the same item in a row merge into one step, as they do in the undo history. The before-and-after result is still exact.
  • Closing the project while recording stops it and keeps the steps so far, but there is then no "after" project, and the recording says so.

Where it is saved

In the recordings folder of your QElectroTech data folder, one folder per recording:

System Folder
Linux ~/.local/share/QElectroTech/QElectroTech/recordings/
Windows %APPDATA%\QElectroTech\QElectroTech\recordings\
macOS ~/Library/Application Support/QElectroTech/QElectroTech/recordings/
recordings/<id>/
    recording.json   name, project, start and stop time, the steps
    before.qet       the whole project when you started recording
    after.qet        the whole project when you stopped
    steps/003.xml    the sheet the step happened on, as it was after step 3

qet-assistant.json (see script buttons) lists the recordings and whether one is under way; in live mode, qet_live_status says so too.

On a very large project, saving before.qet and after.qet can take a few seconds, as saving the project does β€” at start and stop only, not at each step.


Turning it into a script

Paste the copied request into the assistant's chat. It names the recording and asks the assistant to read it with qet_recording_read, write a script that does the same in general (on the selected items rather than on those particular ones), check it with qet_recording_check until it matches, then offer it as a button with qet_script_install. You can add to it: "…and make it work on every sheet".

Tool Does Needs QET_ENABLE_SCRIPTING=1
qet_recording_list the recordings, newest first: id, name, steps, project no
qet_recording_read one recording as structured changes β€” each step's name, sheet, selection and what changed on the sheet ("element KA1 moved by (20, 0)", "wire added between …") β€” and the overall change from before to after no
qet_recording_check runs a script on a copy of before.qet, starting from the same sheet and selection you had, and compares the result with after.qet: matches, or what differs yes
qet_recording_remove deletes one recording yes

qet_recording_check is what makes "the script does what I did" a measured fact rather than the assistant's guess. A rotation by the wrong angle, a script that does nothing, or one that fails β€” each is reported, the last with the line that failed.


Worked example

  1. Select the two coils on a sheet.
  2. Project > Scripts > Record a macro.
  3. Rotate the selection twice (Space, Space).
  4. Stop β†’ Copy the request for the assistant β†’ paste into the chat.
  5. The assistant reads 2 steps, writes "rotate every selected symbol by 180Β°", and qet_recording_check reports a match. A first try at 90Β° would be reported a quarter turn off.
  6. It installs the script; a Scripts toolbar button appears. Next time, select any symbols and click it.

Limitations

  • One project per recording.
  • No clicks or positions replayed β€” on purpose, see above.
  • QElectroTech does not call an assistant itself. That would mean API keys, network access and a choice of provider inside QElectroTech: a different project.
  • macOS has not been tested.

See also

Getting Started

Home

🌐 Languages β€” English Β· FranΓ§ais Β· Deutsch

Downloads

Windows without admin rights β€” the portable archive, no installer

Quick Start Guide

User Manual

FAQ

Tips & Tricks

Guides

Conductors β€” wire properties, what feeds which export, cables, and hops where wires cross

Wires per terminal β€” limit the wires on a terminal, chain wiring instead of stars

Printing and exporting β€” paper, PDF, images, and what each path does differently

Linking elements β€” master, slave, terminal

PLC modules β€” I/O tables and linking a wire to a specific point

Using the element editor β€” drawing tools, saving, checks

Grid size and element size β€” why symbols aren't all the same scale, and scaling one without leaving the grid

Preferences reference β€” what each settings page does

Saving and loading settings β€” your whole setup in one file, to copy or keep

Keyboard-only control β€” mouseless QET, and what still needs a mouse

Mouse modifiers β€” what Shift, Ctrl and Alt change while you drag

3D mouse β€” SpaceMouse pan, zoom and buttons

Aligning items β€” snap symbols back to the grid, or line them up

Pictures on a sheet β€” labels, crop, transparency, what they cost in the file

Arcs and curved wires β€” the Arc tool, pulling an arc in or out, rounding a corner with a fillet, dashed arcs for lighting layouts

Grouping items β€” select, move and copy several items as one

Finding your place on a sheet β€” go to a cell like B13 or 4-B7, keep the headers in sight, show the cell limits, zoom and pan

Showing and hiding kinds of items β€” hide texts, wire numbers, shapes, pictures, tables or cross-references on every sheet

Drawing faster β€” place without dragging, the S shortcut bar, command search, gestures

Customising QElectroTech β€” keys, toolbar size and contents, the gesture ring (partly pending)

Managing collections β€” folders, writability, building your own shortlist

Templates β€” reusable multi-element blocks, placed by double-click or drag

Search & Replace β€” bulk property changes

Building a nomenclature query β€” the BOM/summary table builder

Linking wires across pages β€” sheet reports

Variables & formulas β€” %f, %{label}, sequences

Auto-numbering β€” schemes, sequences, freezing

Terminal strips β€” strips, levels, bridges

Title block templates β€” the .titleblock format

Importing EPLAN parts (.edz) β€” EPLAN Data Portal

DXF import & export β€” two unrelated features, one format; command-line export and layers

The project database β€” the in-memory SQLite cache

File formats
Elements XML
Project XML
Development

Building from Source

Contributing Code

Automating QET β€” CLI, XML formats, external tools

CLI Reference β€” command line usage

JavaScript Scripting β€” --run, geometry editing, undo

MCP server β€” let an AI assistant read, verify and edit projects

Connecting an AI assistant β€” setup for Claude, Copilot, Gemini, Codex, Cursor, LM Studio

Script buttons β€” stored scripts with an icon, by hand or by an assistant

Live mode β€” an assistant working in the open project while you watch

Macro recorder β€” record a task by hand, for an assistant to script

Development Roadmap

Vision β€” proposal, under discussion

Developer Tools

About

Features

History

Community

License

Contributing to this Wiki

Clone this wiki locally