{"slug": "i-built-a-lightweight-macro-recorder-in-rust-mostly-with-an-ai-agent", "title": "I Built a Lightweight Macro Recorder in Rust (Mostly with an AI Agent)", "summary": "A developer built a lightweight macro recorder in Rust, using an AI agent for most of the code while handling architecture and complex parts manually. The tool supports UI Automation, image search, OCR, and fixed coordinates, and is available as an open-source project on GitHub.", "body_md": "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.\n\nSo I wrote my own.\n\n`.exe`\n\n, no installer`If`\n\n/ `While`\n\n, variables, and screen conditionsFour approaches, ordered from cheapest to most expensive:\n\n**Windows UI Automation** by name\n\nNo coordinates, no thresholds. Works well for normal desktop apps. Almost useless in games that draw their own UI.\n\n**Image search**\n\nYou paste a screenshot snippet (Win+Shift+S). I added the ability to restrict the search area. On my 1440p monitor this dropped the average step from ~78 ms to ~7 ms.\n\n**OCR** via the built-in Windows engine\n\nNo external models to download.\n\n**Fixed coordinates**\n\nDPI-aware and anchored to the target window.\n\nThe majority of the code was written with an AI agent. I directed the architecture, reviewed every part, fixed the non-trivial pieces (especially the image-search optimization and proper DPI handling), and made the design decisions. The final codebase is still normal, readable Rust.\n\n`SendInput`\n\ncan be detected by some anti-cheatsNo telemetry, no accounts, no ads.\n\nI’m mainly looking for feedback on the architecture and any better approaches for the image search / OCR parts.\n\nThe repository is public:\n\n[[https://github.com/blackixxce12/macro-recorder](https://github.com/blackixxce12/macro-recorder)]", "url": "https://wpnews.pro/news/i-built-a-lightweight-macro-recorder-in-rust-mostly-with-an-ai-agent", "canonical_source": "https://dev.to/blackixxce12/i-built-a-lightweight-macro-recorder-in-rust-mostly-with-an-ai-agent-27f4", "published_at": "2026-08-19 09:01:37+00:00", "updated_at": "2026-08-19 09:11:52.798464+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools"], "entities": ["Rust", "Windows UI Automation", "GitHub", "blackixxce12"], "alternates": {"html": "https://wpnews.pro/news/i-built-a-lightweight-macro-recorder-in-rust-mostly-with-an-ai-agent", "markdown": "https://wpnews.pro/news/i-built-a-lightweight-macro-recorder-in-rust-mostly-with-an-ai-agent.md", "text": "https://wpnews.pro/news/i-built-a-lightweight-macro-recorder-in-rust-mostly-with-an-ai-agent.txt", "jsonld": "https://wpnews.pro/news/i-built-a-lightweight-macro-recorder-in-rust-mostly-with-an-ai-agent.jsonld"}}