Let an AI Agent Resize a Window and Take the Screenshot
- Metaphor Projects
- Application
- 29 Apr, 2026
Screen automation is easiest to trust when the result is visible and repeatable. In this short demo, an AI agent uses the OverRec screen skill to find a browser window, resize it to an exact rectangle, and capture a clean screenshot without manual dragging.
What the Demo Shows
The target is a Chrome window open to the Hermes Agent website. The agent is running in a terminal and has access to the overrec-screen skill, which wraps OverRec’s window tools.
The workflow is simple:
- Confirm OverRec is available
- Find the target window
- Move and resize it to an exact position
- Take a screenshot of that exact region
- Copy the screenshot to the requested output path
No manual window positioning is involved.
Step 1: Ask the Agent for the Screen Task
The agent is given a task like:
Use overrec-screen skill to resize the Hermes Agent window to 800x600
and take a screenshot.
The important part is that the instruction describes the desired result, not every low-level command. The skill gives the agent a reliable way to translate that request into window operations.
Step 2: Find the Window
The agent first searches for a matching window title:
OverRec.exe cli window hermes
When the exact title is not found, it broadens the search by listing visible windows:
OverRec.exe cli window --all hermes
OverRec.exe cli window edge
OverRec.exe cli window
In the demo, the Hermes Agent page is open in Google Chrome, and OverRec returns its window ID. Once the agent has that ID, it can control the window directly.
Step 3: Snap the Browser to an Exact Rectangle
The agent snaps the Chrome window to position 150,150 with size 800x600:
OverRec.exe cli snap --windowid 264604 --location 150,150 --size 800x600
OverRec restores the window if needed, moves it, resizes it, and brings it forward. The result is a predictable browser frame in the same place every time.
That repeatability matters for:
- documentation screenshots
- UI comparison images
- agent workflows that need visual confirmation
- bug reports where the capture should show the same region every run
Step 4: Capture the Screenshot
After the window is positioned, the agent uses OverRec to capture the same rectangle:
OverRec.exe cli screenshot --location 150,150 --size 800x600 --output "C:\Users\HP\storage\screenshots\overrec\hermes_agent.png" --no-clipboard
The screenshot is written directly to disk, so the workflow does not depend on the clipboard or a manual save step.
Why This Is Useful for AI Workflows
AI agents can reason about tasks, but desktop screenshots are only useful when the screen state is controlled. If a browser is half off-screen, hidden behind another app, or slightly different in size every time, screenshots become noisy.
OverRec gives the agent deterministic screen control:
- find a window by title
- place it at exact coordinates
- resize it to exact dimensions
- capture the exact region needed
That turns “take a screenshot of this app” from a fragile visual task into a repeatable automation step.
The Core Pattern
For any window, the pattern is:
OverRec.exe cli window <search text>
OverRec.exe cli snap --windowid <ID> --location <X,Y> --size <WIDTH>x<HEIGHT>
OverRec.exe cli screenshot --location <X,Y> --size <WIDTH>x<HEIGHT> --output "<file>"
Use the GUI when you want to draw the rectangle by hand. Use the CLI when you want the same result from a script, terminal, or AI agent.
Download OverRec from the Microsoft Store.