Capture Screen (macOS)
Find, control, and screenshot specific macOS application windows programmatically using Swift, AppleScript, and screencapture.
AutomationIntermediate★ 1,348⑂ 215AI score 9/10Last updated: Aug 24, 2026
What it does
- Locates a numeric Window ID by app or title keyword using Swift +
CGWindowListCopyWindowInfo(the only reliable route on macOS). - Prepares the view before capture via AppleScript: activate an app, set Excel zoom, scroll to a row/column, switch sheets, select cell ranges.
- Captures just that window with
screencapture -x -l <WID>, supports PNG/JPEG/delay/region, and downsizes Retina 2x output withsips. - Documents a "failed approaches" table (System Events window id, PyObjC Quartz) so you avoid dead ends.
- Includes a Screen Recording permission triage checklist plus one-liners to open the right System Settings pane.
Who it's for
- macOS users who repeatedly produce screenshots for docs, guides, or release notes.
- Analysts capturing several consistent views of the same Excel workbook or dashboard.
- Developers and technical writers automating demo imagery or visual checks.
Examples
- "Open model.xlsx, set zoom to 130%, and capture the Summary sheet at rows 1 and 45" → opens the file, sets the view, re-fetches the WID, writes two PNGs.
- "Grab only the Chrome window" →
swift scripts/get_window_id.swift Chrome, then capture by that WID. - When capture fails with
ERROR: Failed to enumerate windows, it opens the Privacy & Security → Screen Recording pane and walks the permission checklist.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/daymade/claude-code-skills/HEAD/capture-screen/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the capture-screen folder from the GitHub repo daymade/claude-code-skills into my ~/.claude/skills/capture-screen/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/daymade/claude-code-skills.git /tmp/claude-code-skills && mkdir -p ~/.claude/skills && cp -r /tmp/claude-code-skills/capture-screen ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open Terminal (Applications → Utilities → Terminal).
- Clone the repo:
git clone https://github.com/daymade/claude-code-skills.git - Create the skills folder:
mkdir -p ~/.claude/skills - Copy this skill only:
cp -r claude-code-skills/capture-screen ~/.claude/skills/ - Make sure Swift is available:
xcode-select --install(skip if Xcode Command Line Tools are installed). - Grant Screen Recording permission to your terminal (or the app running Claude Code) in System Settings → Privacy & Security → Screen Recording, then restart that app.
- Restart Claude Code and ask something like "capture the Excel window" to trigger the skill.
View source on GitHub ↗License: MIT