| name | windows-control |
| description | Full Windows desktop control. Mouse, keyboard, screenshots - interact with any Windows application like a human. |
Windows Control Skill
Full desktop automation for Windows. Control mouse, keyboard, and screen like a human user.
Quick Start
All scripts are in skills/windows-control/scripts/
Screenshot
py screenshot.py > output.b64
Returns base64 PNG of entire screen.
Click
py click.py 500 300
py click.py 500 300 right
py click.py 500 300 left 2
Type Text
py type_text.py "Hello World"
Types text at current cursor position (10ms between keys).
Press Keys
py key_press.py "enter"
py key_press.py "ctrl+s"
py key_press.py "alt+tab"
py key_press.py "ctrl+shift+esc"
Move Mouse
py mouse_move.py 500 300
Moves mouse to coordinates (smooth 0.2s animation).
Scroll
py scroll.py up 5
py scroll.py down 10
Window Management (NEW!)
py focus_window.py "Chrome"
py minimize_window.py "Notepad"
py maximize_window.py "VS Code"
py close_window.py "Calculator"
py get_active_window.py
Advanced Actions (NEW!)
py click_text.py "Save"
py click_text.py "Submit" "Chrome"
py drag.py 100 100 500 300
py wait_for_text.py "Ready" "App" 30
py wait_for_window.py "Notepad" 10
py find_text.py "Login" "Chrome"
py list_windows.py
Read Window Text
py read_window.py "Notepad"
py read_window.py "Visual Studio"
py read_window.py "Chrome"
Uses Windows UI Automation to extract actual text (not OCR). Much faster and more accurate than screenshots!
Read UI Elements (NEW!)
py read_ui_elements.py "Chrome"
py read_ui_elements.py "Chrome" --buttons-only
py read_ui_elements.py "Chrome" --links-only
py read_ui_elements.py "Chrome" --json
Returns buttons, links, tabs, checkboxes, dropdowns with coordinates for clicking.
Read Webpage Content (NEW!)
py read_webpage.py
py read_webpage.py "Chrome"
py read_webpage.py "Chrome" --buttons
py read_webpage.py "Chrome" --links
py read_webpage.py "Chrome" --full
py read_webpage.py "Chrome" --json
Enhanced browser content extraction with headings, text, buttons, and links.
Handle Dialogs (NEW!)
py handle_dialog.py list
py handle_dialog.py read
py handle_dialog.py read --json
py handle_dialog.py click "OK"
py handle_dialog.py click "Save"
py handle_dialog.py click "Yes"
py handle_dialog.py type "myfile.txt"
py handle_dialog.py type "C:\path\to\file" --field 0
py handle_dialog.py dismiss
py handle_dialog.py wait --timeout 10
py handle_dialog.py wait "Save As" --timeout 5
Handles Save/Open dialogs, message boxes, alerts, confirmations, etc.
Click Element by Name (NEW!)
py click_element.py "Save"
py click_element.py "OK" --window "Notepad"
py click_element.py "Submit" --type Button
py click_element.py "File" --type MenuItem
py click_element.py --list
py click_element.py --list --window "Chrome"
Click buttons, links, menu items by name without needing coordinates.
Read Screen Region (OCR - Optional)
py read_region.py 100 100 500 300
Note: Requires Tesseract OCR installation. Use read_window.py instead for better results.
Workflow Pattern
- Read window - Extract text from specific window (fast, accurate)
- Read UI elements - Get buttons, links with coordinates
- Screenshot (if needed) - See visual layout
- Act - Click element by name or coordinates
- Handle dialogs - Interact with popups/save dialogs
- Read window - Verify changes
Screen Coordinates
- Origin (0, 0) is top-left corner
- Your screen: 2560x1440 (check with screenshot)
- Use coordinates from screenshot analysis
Examples
Open Notepad and type
py key_press.py "win"
py type_text.py "notepad"
py key_press.py "enter"
py type_text.py "Hello from AI!"
py key_press.py "ctrl+s"
Click in VS Code
py read_window.py "Visual Studio Code"
py click.py 50 100
py type_text.py "test.js"
py key_press.py "enter"
py read_window.py "Visual Studio Code"
Monitor Notepad changes
py read_window.py "Notepad"
py read_window.py "Notepad"
Text Reading Methods
Method 1: Windows UI Automation (BEST)
- Use
read_window.py for any window
- Use
read_ui_elements.py for buttons/links with coordinates
- Use
read_webpage.py for browser content with structure
- Gets actual text data (not image-based)
Method 2: Click by Name (NEW)
- Use
click_element.py to click buttons/links by name
- No coordinates needed - finds elements automatically
- Works across all windows or target specific window
Method 3: Dialog Handling (NEW)
- Use
handle_dialog.py for popups, save dialogs, alerts
- Read dialog content, click buttons, type text
- Auto-dismiss with common buttons (OK, Cancel, etc.)
Method 4: Screenshot + Vision (Fallback)
- Take full screenshot
- AI reads text visually
- Slower but works for any content
Method 5: OCR (Optional)
- Use
read_region.py with Tesseract
- Requires additional installation
- Good for images/PDFs with text
Safety Features
pyautogui.FAILSAFE = True (move mouse to top-left to abort)
- Small delays between actions
- Smooth mouse movements (not instant jumps)
Requirements
- Python 3.11+
- pyautogui (installed ✅)
- pillow (installed ✅)
Tips
- Always screenshot first to see current state
- Coordinates are absolute (not relative to windows)
- Wait briefly after clicks for UI to update
- Use
ctrl+z friendly actions when possible
Status: ✅ READY FOR USE (v2.0 - Dialog & UI Elements)
Created: 2026-02-01
Updated: 2026-02-02