Urgent.News

What's breaking now, across thousands of outlets.

Tech

I Built a Lightweight Macro Recorder in Rust (Mostly with an AI Agent)

I got tired of closed-source macro tools. Most of them store macros in binary formats, have poor DPI awareness, and install global keyboard hooks. For a tool that essentially injects input, closed source felt uncomfortable. So I wrote my own. What it is Single ~7 MB .exe , no installer MIT license Macros are plain JSON (easy to edit and diff) Small scripting layer on top: If / While , variables,…

Writer <NAME> expresses frustration with closed-source macro tools, which have issues like binary storage, poor DPI awareness, and global keyboard hook installation. To address these concerns, the developer created their own lightweight macro recorder in Rust. The finished product is a 7 MB .exe file, released under the MIT license, with no installer.

Macros are stored in plain JSON, enabling easy editing and diffing. The software incorporates a small scripting layer, providing If / While commands, variables, and screen condition checks.

Four strategies are outlined for detecting UI elements, ordered from least to most resource-intensive. First, Windows UI Automation by name is used, requiring no coordinates or thresholds and functioning well for standard desktop applications. Second, image search is employed by allowing users to paste a screenshot snippet (using Win+Shift+S).

The image search capability was enhanced by restricting the search area, resulting in a significant reduction in average step time from around 78 ms to approximately 7 ms on a 1440p monitor. Third, OCR via the built-in Windows engine is utilized, with no external models required. Lastly, fixed coordinates are employed, ensuring DPI-awareness and anchoring to the target window.

The developer acknowledges the involvement of an AI agent in the majority of the code creation process. While the AI contributed to the overall architecture, review, and correction of non-trivial elements such as image-search optimization and proper DPI handling, the final codebase remains well-structured and easily readable Rust.

The developer has acknowledged certain limitations, such as Windows-only compatibility, the potential detection of SendInput by some anti-cheats, and the resemblance of global hooks and synthetic input to keyloggers in the eyes of many antivirus products. These concerns are addressed by providing VirusTotal results instead of hiding them.

The repository for this project is openly accessible at [https://github.com/blackixxce12/macro-recorder]. The author invites feedback on the overall design and any potential improvements for the image search and OCR components.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

React useScrollLock Hook: Lock Body Scroll for Modals (2026)

Your modal is open, centered, perfect. Then someone flicks the overlay and the page behind it scrolls away underneath. Everyone's first fix is the same three lines: useEffect (() => { document .

  • Prevents page scrolling when modal is open
  • Use useEffect to control overflow property
  • @reactuses/core's useScrollLock hook addresses issues

More from Wednesday 19 August →