Spliff7777

Windows Control

其他v1.0.0
作者:Spliff7777更新于 2026-05-18windows-control

据 AlphaMoat 统计,截至 2026-10,Windows Control 累计下载 9,664 次、获 29 个星标,按累计下载量在本次参与排名的 10,914 个 AI 技能中排名第 2,838 位,在「其他」分类(88 个)中排名第 8 位。

列表默认按累计下载量排序,也可按星标排序;详情页排名按累计下载量计算。

累计下载
9,664
星标
29
全站下载量排名
#2,838
全站前 27% · 「其他」前 10%
平台累计下载星标评论
ClawHub ↗9,66429-

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

它通过 skills/windows-control/scripts/ 下的 py 脚本工作:截图(返回 base64 PNG)、左右/双击、键入文本、组合键(如 ctrl+s、alt+tab)、滚动、移动鼠标、聚焦/最小化/最大化/关闭窗口,还支持按文本或名称点击元素(无需坐标)、拖放、等待文本或窗口出现、列出窗口、读取窗口文本(用 Windows UI Automation 提取真实文本,而非 OCR)、读取 UI 元素与网页内容、处理 Save/Open 等对话框。安全方面启用 pyautogui.FAILSAFE(鼠标移到左上角中止)、动作间小延迟与平滑移动。要求 Python 3.11+、pyautogui 与 pillow;OCR 为可选,需另装 Tesseract。

资料发布于 2026-10-27

可以用来做什么

  • 用脚本控制 Windows 鼠标、键盘与窗口
  • 按名称或文本点击按钮、链接与菜单项而无需坐标
  • 用 UI Automation 读取窗口与对话框的真实文本

什么时候用

  • 需要自动化操作 Windows 桌面应用时
  • 要读取窗口文本、UI 元素或网页内容时
  • 要自动处理保存/打开等系统对话框时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

截一张全屏图给我。
在 Chrome 里点击“Submit”按钮。
读取记事本窗口里的所有文本。

月度数据趋势

累计下载9,664
8,5689,1579,7452026-05 · 累计下载 8,6492026-07 · 累计下载 9,3612026-08 · 累计下载 9,4402026-09 · 累计下载 9,5232026-10 · 累计下载 9,66426-0526-0926-10
星标29
2931322026-05 · 星标 322026-07 · 星标 292026-08 · 星标 292026-09 · 星标 292026-10 · 星标 2926-0526-0926-10

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。 该技能有同名的其他版本,调整前的数据归属当前下载量最大的这一个。

月份累计下载环比星标
2026-109,664—29
2026-099,523—29
2026-089,440+0.8%29
2026-079,361—29
2026-058,649—32

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

7.3 KB · ClawHub v1.0.0
---
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
展开全部(共 266 行)

All scripts are in `skills/windows-control/scripts/`

### Screenshot
```bash
py screenshot.py > output.b64
```
Returns base64 PNG of entire screen.

### Click
```bash
py click.py 500 300              # Left click at (500, 300)
py click.py 500 300 right        # Right click
py click.py 500 300 left 2       # Double click
```

### Type Text
```bash
py type_text.py "Hello World"
```
Types text at current cursor position (10ms between keys).

### Press Keys
```bash
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
```bash
py mouse_move.py 500 300
```
Moves mouse to coordinates (smooth 0.2s animation).

### Scroll
```bash
py scroll.py up 5      # Scroll up 5 notches
py scroll.py down 10   # Scroll down 10 notches
```

### Window Management (NEW!)
```bash
py focus_window.py "Chrome"           # Bring window to front
py minimize_window.py "Notepad"       # Minimize window
py maximize_window.py "VS Code"       # Maximize window
py close_window.py "Calculator"       # Close window
py get_active_window.py               # Get title of active window
```

### Advanced Actions (NEW!)
```bash
# Click by text (No coordinates needed!)
py click_text.py "Save"               # Click "Save" button anywhere
py click_text.py "Submit" "Chrome"    # Click "Submit" in Chrome only

# Drag and Drop
py drag.py 100 100 500 300            # Drag from (100,100) to (500,300)

# Robust Automation (Wait/Find)
py wait_for_text.py "Ready" "App" 30  # Wait up to 30s for text
py wait_for_window.py "Notepad" 10    # Wait for window to appear
py find_text.py "Login" "Chrome"      # Get coordinates of text
py list_windows.py                    # List all open windows
```

### Read Window Text
```bash
py read_window.py "Notepad"           # Read all text from Notepad
py read_window.py "Visual Studio"     # Read text from VS Code
py read_window.py "Chrome"            # Read text from browser
```
Uses Windows UI Automation to extract actual text (not OCR). Much faster and more accurate than screenshots!

### Read UI Elements (NEW!)
```bash
py read_ui_elements.py "Chrome"               # All interactive elements
py read_ui_elements.py "Chrome" --buttons-only  # Just buttons
py read_ui_elements.py "Chrome" --links-only    # Just links
py read_ui_elements.py "Chrome" --json          # JSON output
```
Returns buttons, links, tabs, checkboxes, dropdowns with coordinates for clicking.

### Read Webpage Content (NEW!)
```bash
py read_webpage.py                     # Read active browser
py read_webpage.py "Chrome"            # Target Chrome specifically
py read_webpage.py "Chrome" --buttons  # Include buttons
py read_webpage.py "Chrome" --links    # Include links with coords
py read_webpage.py "Chrome" --full     # All elements (inputs, images)
py read_webpage.py "Chrome" --json     # JSON output
```
Enhanced browser content extraction with headings, text, buttons, and links.

### Handle Dialogs (NEW!)
```bash
# List all open dialogs
py handle_dialog.py list

# Read current dialog content
py handle_dialog.py read
py handle_dialog.py read --json

# Click button in dialog
py handle_dialog.py click "OK"
py handle_dialog.py click "Save"
py handle_dialog.py click "Yes"

# Type into dialog text field
py handle_dialog.py type "myfile.txt"
py handle_dialog.py type "C:\path\to\file" --field 0

# Dismiss dialog (auto-finds OK/Close/Cancel)
py handle_dialog.py dismiss

# Wait for dialog to appear
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!)
```bash
py click_element.py "Save"                    # Click "Save" anywhere
py click_element.py "OK" --window "Notepad"   # In specific window
py click_element.py "Submit" --type Button    # Only buttons
py click_element.py "File" --type MenuItem    # Menu items
py click_element.py --list                    # List clickable elements
py click_element.py --list --window "Chrome"  # List in specific window
```
Click buttons, links, menu items by name without needing coordinates.

### Read Screen Region (OCR - Optional)
```bash
py read_region.py 100 100 500 300     # Read text from coordinates
```
Note: Requires Tesseract OCR installation. Use read_window.py instead for better results.

## Workflow Pattern

1. **Read window** - Extract text from specific window (fast, accurate)
2. **Read UI elements** - Get buttons, links with coordinates
3. **Screenshot** (if needed) - See visual layout
4. **Act** - Click element by name or coordinates
5. **Handle dialogs** - Interact with popups/save dialogs
6. **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
```bash
# Press Windows key
py key_press.py "win"

# Type "notepad"
py type_text.py "notepad"

# Press Enter
py key_press.py "enter"

# Wait a moment, then type
py type_text.py "Hello from AI!"

# Save
py key_press.py "ctrl+s"
```

### Click in VS Code
```bash
# Read current VS Code content
py read_window.py "Visual Studio Code"

# Click at specific location (e.g., file explorer)
py click.py 50 100

# Type filename
py type_text.py "test.js"

# Press Enter
py key_press.py "enter"

# Verify new file opened
py read_window.py "Visual Studio Code"
```

### Monitor Notepad changes
```bash
# Read current content
py read_window.py "Notepad"

# User types something...

# Read updated content (no screenshot needed!)
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

「其他」分类下的热门技能

数据月份:2026-10 · 下载/星标数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。