Works with the AI Agents you already use

    macOS Background Desktop Control

    by NaghtSieger

    0

    Control native macOS apps and iPhone Mirroring with pure Swift scripts—background Accessibility actions, shadow-free single-window screenshots, Apple Vision OCR pixel centers, Retina coordinate scaling, smooth trackpad gestures, and clipboard-preserving paste.

    $14.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    What it does

    • Inspects macOS permissions, lock-screen state, display scaling, and open windows with zero helper apps
    • Reads AXUIElement trees and clicks buttons, edits fields, or selects text in background windows silently
    • Captures shadow-free single-window PNGs and runs local Apple Vision OCR for exact pixel click centers
    • Converts 2x/3x Retina pixels to exact logical points for accurate clicks, drags, and trackpad scrolls
    • Types Unicode directly or pastes via Cmd+V while backing up and restoring your original clipboard
    • Includes a dedicated iPhone Mirroring recipe using continuous trackpad scroll phases and OCR targeting

    Who it's for

    macOS developers & QA engineers

    Automated end-to-end GUI checks on native Mac apps without writing fragile UI test harnesses

    Try asking: “Inspect my open Safari window, click the Login button via Accessibility without moving my mouse, and confirm the next sc”

    Power users automating Mac workflows

    Reliable control over apps with no API (accounting tools, Electron apps, Notes, Mail) without losing their clipboard

    Try asking: “Find the Export button in my open PDF app using Apple Vision OCR, click it, and paste this filename without overwriting”

    iOS & mobile testers

    Hands-free navigation inside macOS iPhone Mirroring using continuous trackpad scroll and OCR tap centers

    Try asking: “Activate iPhone Mirroring, capture an OCR screenshot, scroll down smoothly, and tap the Settings row.”

    AI coding agent builders

    Zero-dependency pure Swift CLI scripts that work across Claude Code, Cursor, Codex CLI, Gemini CLI, and Antigravity

    Try asking: “Check my macOS Accessibility and Screen Recording permissions and list all open windows with their logical bounds.”

    macOS Background Desktop Control

    macOS Background Desktop Control

    Example session with this skill installed

    Check my macOS permissions, find the open Finder window, read its Accessibility controls in the background, and locate any visible text in a screenshot using Apple Vision OCR.

    • Read your context and instructions
    • Compiled the macos background desktop
    1. Runs mac_windows.swift capabilities to verify permissions and lock-screen safety:
      {"ok":true,"sessionLocked":false,"permissions":{"accessibility":true,"screenRecording":true},"displays":[{"index":0,"x":0,"y":0,"width":2560,"height":1440,"scale":2,"primary":true}]}
    2. Runs mac_windows.swift list-windows --app Finder to get the window ID, PID, and logical bounds:
      {"ok":true,"sessionLocked":false,"count":1,"windows":[{"windowId":4182,"pid":512,"appName":"Finder","bundleId":"com.apple.finder","title":"Documents","bounds":{"x":120,"y":90,"width":960,"height":640},"layer":0,"isOnScreen":true,"frontmost":false}]}
    3. Runs mac_ax.swift tree --pid 512 --details to inspect controls in the background without moving the cursor:
      AXApplication "Finder" [path=root] -> AXWindow "Documents" [path=1] -> AXToolbar [path=1.2] -> AXButton "Search" [path=1.2.4] actions=["AXPress"]
    4. Invokes the button directly in the background with mac_ax.swift invoke --pid 512 --path 1.2.4 --action AXPress ({"ok":true,"dispatched":true,"action":"AXPress"}).
    5. Confirms visual state with mac_capture_ocr.swift screenshot --window-id 4182 --ocr --lang en-US:
      {"ok":true,"pixelWidth":1920,"pixelHeight":1280,"scaleX":2,"scaleY":2,"ocr":{"items":[{"text":"Search","bbox":[1580,44,1672,76],"center":[1626,60],"confidence":0.99}]}}
    6. When clicking an OCR center on a Retina display, passes --window-bounds "120,90,960,640" --image-size "1920,1280" to mac_input.swift click --x 1626 --y 60, landing on exact logical screen point (933, 120) and removing the temporary screenshot afterward.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Native macOS desktop apps rarely ship APIs, and most generic computer-use prompts fail on Retina coordinate scaling, steal your mouse cursor, overwrite your clipboard, or break completely on Electron apps and iPhone Mirroring.

    How it works

    This skill gives your AI agent four focused, zero-dependency Swift scripts that run directly on macOS's built-in frameworks (AppKit, ApplicationServices, CoreGraphics, and Vision):

    1. Preflight & Window Discovery: Checks Accessibility, Screen Recording, and lock-screen state (SESSION_LOCKED fail-closed guard) before listing open windows with their PID, bundle ID, and logical bounds.
    2. Background Accessibility First: Walks the AXUIElement tree using deterministic element paths so the agent can press buttons, fill text fields, and select text in background windows without moving your mouse.
    3. Single-Window Capture + Apple Vision OCR: Captures shadow-free single-window PNGs and extracts line-level English and CJK text bounding boxes and pixel centers locally via Apple Vision.
    4. Retina-Accurate Input & Gestures: Converts Retina screenshot pixels to exact logical screen points automatically, emits continuous pixel-delta trackpad scroll phases (required by iPhone Mirroring), runs smooth HID drags, types Unicode directly, and restores your clipboard after paste.

    Frameworks & tools

    Built purely on native macOS swift and Apple system frameworks (AppKit, ApplicationServices, CoreGraphics, ImageIO, Vision, /usr/sbin/screencapture). No external daemon, no third-party app installation, and no external API keys required.

    Why this beats prompting it yourself

    Writing macOS GUI automation from scratch consistently trips over five subtle bugs: Retina 2x/3x pixel-to-point drift, discrete scroll wheel events being ignored by iPhone Mirroring, missing lock-screen guards, stuck modifier keys, and overwriting the user's clipboard during paste. Every one of these edge cases is pre-solved in battle-tested, compact Swift scripts with deterministic JSON output.

    Use cases

    • Driving native macOS software that has no CLI or API
    • Automating Electron, Chrome, or canvas-heavy desktop apps using local Apple Vision OCR
    • Navigating and testing iOS apps through macOS iPhone Mirroring
    • Verifying desktop UI regressions inside an AI coding agent session

    Known limitations

    • Requires macOS 12+ with Xcode Command Line Tools (swift command available).
    • The user must grant Accessibility and Screen Recording permissions to the terminal or AI coding app running the scripts.
    • Some protected macOS surfaces ignore background PID-targeted synthetic clicks and require bringing the window to the foreground first (handled automatically by the skill's verify-and-fallback workflow).

    - **Scripts included** (each self-contained, under 16 KB, pure UTF-8 Swift): - `scripts/mac_windows.swift` (`capabilities`, `list-windows`, `activate`) - `scripts/mac_capture_ocr.swift` (`screenshot`, `ocr`) - `scripts/mac_ax.swift` (`tree`, `invoke`, `set-value`, `select-text`) - `scripts/mac_input.swift` (`move`, `click`, `scroll`, `drag`, `type-text`, `press-key`, `paste`) - **Output format**: Single-line UTF-8 JSON on stdout; non-zero exit code with structured `{"ok":false,"error":"..."}` on failures (`exit 2` on `SESSION_LOCKED`). - **Temporary files**: Screenshots are written to `--output` or system temporary storage and removed after verification. No persistent daemon or system config edits.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 day ago

    Mac only

    Software
    SwiftAccessibility permissionScreen Recording permission

    Permissions

    Terminal / Shell
    Write Files
    Listed1 day ago

    What's inside

    Frequently Asked Questions

    No. It runs directly using macOS's built-in swift runtime and native Apple frameworks.

    No. The paste command backs up your existing clipboard text, sends Cmd+V, and restores your previous clipboard automatically.

    Yes. Passing --window-bounds and --image-size from the screenshot JSON automatically converts 2x/3x Retina OCR pixels into exact logical screen coordinates across multiple displays.

    New in Agents & Orchestration

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.