{
  "schemaVersion": "1.0",
  "item": {
    "slug": "mac-control",
    "name": "Mac Control",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/EasonC13/mac-control",
    "canonicalUrl": "https://clawhub.ai/EasonC13/mac-control",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/mac-control",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mac-control",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "scripts/calibrate.sh",
      "scripts/click-at-display.sh",
      "scripts/crop-image.sh",
      "scripts/find-element.sh",
      "scripts/get-screen-info.sh"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "mac-control",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-05T06:03:43.560Z",
      "expiresAt": "2026-05-12T06:03:43.560Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mac-control",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=mac-control",
        "contentDisposition": "attachment; filename=\"mac-control-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "mac-control"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/mac-control"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/mac-control",
    "agentPageUrl": "https://openagent3.xyz/skills/mac-control/agent",
    "manifestUrl": "https://openagent3.xyz/skills/mac-control/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/mac-control/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Mac Control",
        "body": "Automate Mac UI interactions using cliclick (mouse/keyboard) and system tools."
      },
      {
        "title": "Tools",
        "body": "cliclick: /opt/homebrew/bin/cliclick - mouse/keyboard control\nscreencapture: Built-in screenshot tool\nmagick: ImageMagick for image analysis\nosascript: AppleScript for window info"
      },
      {
        "title": "Coordinate System (Eason's Mac Mini)",
        "body": "Current setup: 1920x1080 display, 1:1 scaling (no conversion needed!)\n\nScreenshot coords = cliclick coords\nIf screenshot shows element at (800, 500), click at (800, 500)"
      },
      {
        "title": "For Retina Displays (2x)",
        "body": "If screenshot is 2x the logical resolution:\n\n# Convert: cliclick_coords = screenshot_coords / 2\ncliclick c:$((screenshot_x / 2)),$((screenshot_y / 2))"
      },
      {
        "title": "Calibration Script",
        "body": "Run to verify your scale factor:\n\n/Users/eason/clawd/scripts/calibrate-cursor.sh"
      },
      {
        "title": "cliclick Commands",
        "body": "# Click at coordinates\n/opt/homebrew/bin/cliclick c:500,300\n\n# Move mouse (no click) - Note: may not visually update cursor\n/opt/homebrew/bin/cliclick m:500,300\n\n# Double-click\n/opt/homebrew/bin/cliclick dc:500,300\n\n# Right-click\n/opt/homebrew/bin/cliclick rc:500,300\n\n# Click and drag\n/opt/homebrew/bin/cliclick dd:100,100 du:200,200\n\n# Type text\n/opt/homebrew/bin/cliclick t:\"hello world\"\n\n# Press key (Return, Escape, Tab, etc.)\n/opt/homebrew/bin/cliclick kp:return\n/opt/homebrew/bin/cliclick kp:escape\n\n# Key with modifier (cmd+w to close window)\n/opt/homebrew/bin/cliclick kd:cmd t:w ku:cmd\n\n# Get current mouse position\n/opt/homebrew/bin/cliclick p\n\n# Wait before action (ms)\n/opt/homebrew/bin/cliclick -w 100 c:500,300"
      },
      {
        "title": "Screenshots",
        "body": "# Full screen (silent)\n/usr/sbin/screencapture -x /tmp/screenshot.png\n\n# With cursor (may not work for custom cursor colors)\n/usr/sbin/screencapture -C -x /tmp/screenshot.png\n\n# Interactive region selection\nscreencapture -i region.png\n\n# Delayed capture\nscreencapture -T 3 -x delayed.png  # 3 second delay"
      },
      {
        "title": "Workflow: Screenshot → Analyze → Click",
        "body": "Best practice for reliable clicking:\n\nTake screenshot\n/usr/sbin/screencapture -x /tmp/screen.png\n\n\n\nView screenshot (Read tool) to find target coordinates\n\n\nClick at those coordinates (1:1 on 1920x1080)\n/opt/homebrew/bin/cliclick c:X,Y\n\n\n\nVerify by taking another screenshot"
      },
      {
        "title": "Example: Click a button",
        "body": "# 1. Screenshot\n/usr/sbin/screencapture -x /tmp/before.png\n\n# 2. View image, find button at (850, 450)\n# (Use Read tool on /tmp/before.png)\n\n# 3. Click\n/opt/homebrew/bin/cliclick c:850,450\n\n# 4. Verify\n/usr/sbin/screencapture -x /tmp/after.png"
      },
      {
        "title": "Window Bounds",
        "body": "# Get Chrome window bounds\nosascript -e 'tell application \"Google Chrome\" to get bounds of front window'\n# Returns: 0, 38, 1920, 1080  (left, top, right, bottom)"
      },
      {
        "title": "Chrome Extension Icon (Browser Relay)",
        "body": "Use AppleScript to find exact button position:\n\n# Find Clawdbot extension button position\nosascript -e '\ntell application \"System Events\"\n    tell process \"Google Chrome\"\n        set toolbarGroup to group 2 of group 3 of toolbar 1 of group 1 of group 1 of group 1 of group 1 of group 1 of window 1\n        set allButtons to every pop up button of toolbarGroup\n        repeat with btn in allButtons\n            if description of btn contains \"Clawdbot\" then\n                return position of btn & size of btn\n            end if\n        end repeat\n    end tell\nend tell\n'\n# Output: 1755, 71, 34, 34 (x, y, width, height)\n\n# Click center of button\n# center_x = x + width/2 = 1755 + 17 = 1772\n# center_y = y + height/2 = 71 + 17 = 88\n/opt/homebrew/bin/cliclick c:1772,88"
      },
      {
        "title": "Clicking by Color Detection",
        "body": "If you need to find a specific colored element:\n\n# Find red (#FF0000) pixels in screenshot\nmagick /tmp/screen.png txt:- | grep \"#FF0000\" | head -5\n\n# Calculate center of colored region\nmagick /tmp/screen.png txt:- | grep \"#FF0000\" | awk -F'[,:]' '\n  BEGIN{sx=0;sy=0;c=0}\n  {sx+=$1;sy+=$2;c++}\n  END{printf \"Center: (%d, %d)\\n\", sx/c, sy/c}'"
      },
      {
        "title": "Dialog Button Click",
        "body": "Screenshot the dialog\nFind button coordinates visually\nClick (no scaling on 1920x1080)\n\n# Example: Click \"OK\" button at (960, 540)\n/opt/homebrew/bin/cliclick c:960,540"
      },
      {
        "title": "Type in Text Field",
        "body": "# Click to focus, then type\n/opt/homebrew/bin/cliclick c:500,300\nsleep 0.2\n/opt/homebrew/bin/cliclick t:\"Hello world\"\n/opt/homebrew/bin/cliclick kp:return"
      },
      {
        "title": "Helper Scripts",
        "body": "Located in /Users/eason/clawd/scripts/:\n\ncalibrate-cursor.sh - Calibrate coordinate scaling\nclick-at-visual.sh - Click at screenshot coordinates\nget-cursor-pos.sh - Get current cursor position\nattach-browser-relay.sh - Auto-click Browser Relay extension"
      },
      {
        "title": "Keyboard Navigation (When Clicks Fail)",
        "body": "Google OAuth and protected pages block synthetic mouse clicks! Use keyboard navigation:\n\n# Tab to navigate between elements\nosascript -e 'tell application \"System Events\" to keystroke tab'\n\n# Shift+Tab to go backwards\nosascript -e 'tell application \"System Events\" to key code 48 using shift down'\n\n# Enter to activate focused element\nosascript -e 'tell application \"System Events\" to keystroke return'\n\n# Full workflow: Tab 3 times then Enter\nosascript -e '\ntell application \"System Events\"\n    keystroke tab\n    delay 0.15\n    keystroke tab\n    delay 0.15\n    keystroke tab\n    delay 0.15\n    keystroke return\nend tell\n'\n\nWhen to use keyboard instead of mouse:\n\nGoogle OAuth / login pages (anti-automation protection)\nPopup dialogs with focus trapping\nWhen mouse clicks consistently fail after verification"
      },
      {
        "title": "Chrome Browser Relay & Multiple Windows",
        "body": "Problem: Browser Relay may list tabs from multiple Chrome windows, causing snapshot to fail on the desired tab.\n\nSolution:\n\nClose extra Chrome windows before automation\nOr ensure only the target window has relay attached\n\nCheck tabs visible to relay:\n\n# In agent code\nbrowser action=tabs profile=chrome\n\nIf target tab missing from list → wrong window attached.\n\nVerify single window:\n\nosascript -e 'tell application \"Google Chrome\" to return count of windows'"
      },
      {
        "title": "Verify-Before-Click Workflow",
        "body": "Critical: Always verify coordinates BEFORE clicking important buttons.\n\n# 1. Take screenshot\nosascript -e 'do shell script \"/usr/sbin/screencapture -x /tmp/before.png\"'\n\n# 2. View screenshot (Read tool), note target position\n\n# 3. Move mouse to verify position (optional)\npython3 -c \"import pyautogui; pyautogui.moveTo(X, Y)\"\nosascript -e 'do shell script \"/usr/sbin/screencapture -C -x /tmp/verify.png\"'\n\n# 4. Check cursor is on target, THEN click\n/opt/homebrew/bin/cliclick c:X,Y\n\n# 5. Take screenshot to confirm action worked\nosascript -e 'do shell script \"/usr/sbin/screencapture -x /tmp/after.png\"'"
      },
      {
        "title": "Troubleshooting",
        "body": "Click lands wrong: Verify scale factor with calibration script\n\ncliclick m: doesn't move cursor visually: Use c: (click) instead, or check with cliclick p to confirm position changed\n\nPermission denied: System Settings → Privacy & Security → Accessibility → Add /opt/homebrew/bin/node\n\nWindow not found: Check exact app name:\n\nosascript -e 'tell application \"System Events\" to get name of every process whose background only is false'\n\nClicks ignored on OAuth/protected pages: These pages block synthetic events. Use keyboard navigation (Tab + Enter) instead.\n\npyautogui vs cliclick coordinates differ: Stick with cliclick for consistency. pyautogui may have different coordinate mapping.\n\nQuartz CGEvent clicks don't work: Some pages (Google OAuth) block low-level mouse events too. Keyboard is the only reliable method."
      }
    ],
    "body": "Mac Control\n\nAutomate Mac UI interactions using cliclick (mouse/keyboard) and system tools.\n\nTools\ncliclick: /opt/homebrew/bin/cliclick - mouse/keyboard control\nscreencapture: Built-in screenshot tool\nmagick: ImageMagick for image analysis\nosascript: AppleScript for window info\nCoordinate System (Eason's Mac Mini)\n\nCurrent setup: 1920x1080 display, 1:1 scaling (no conversion needed!)\n\nScreenshot coords = cliclick coords\nIf screenshot shows element at (800, 500), click at (800, 500)\nFor Retina Displays (2x)\n\nIf screenshot is 2x the logical resolution:\n\n# Convert: cliclick_coords = screenshot_coords / 2\ncliclick c:$((screenshot_x / 2)),$((screenshot_y / 2))\n\nCalibration Script\n\nRun to verify your scale factor:\n\n/Users/eason/clawd/scripts/calibrate-cursor.sh\n\ncliclick Commands\n# Click at coordinates\n/opt/homebrew/bin/cliclick c:500,300\n\n# Move mouse (no click) - Note: may not visually update cursor\n/opt/homebrew/bin/cliclick m:500,300\n\n# Double-click\n/opt/homebrew/bin/cliclick dc:500,300\n\n# Right-click\n/opt/homebrew/bin/cliclick rc:500,300\n\n# Click and drag\n/opt/homebrew/bin/cliclick dd:100,100 du:200,200\n\n# Type text\n/opt/homebrew/bin/cliclick t:\"hello world\"\n\n# Press key (Return, Escape, Tab, etc.)\n/opt/homebrew/bin/cliclick kp:return\n/opt/homebrew/bin/cliclick kp:escape\n\n# Key with modifier (cmd+w to close window)\n/opt/homebrew/bin/cliclick kd:cmd t:w ku:cmd\n\n# Get current mouse position\n/opt/homebrew/bin/cliclick p\n\n# Wait before action (ms)\n/opt/homebrew/bin/cliclick -w 100 c:500,300\n\nScreenshots\n# Full screen (silent)\n/usr/sbin/screencapture -x /tmp/screenshot.png\n\n# With cursor (may not work for custom cursor colors)\n/usr/sbin/screencapture -C -x /tmp/screenshot.png\n\n# Interactive region selection\nscreencapture -i region.png\n\n# Delayed capture\nscreencapture -T 3 -x delayed.png  # 3 second delay\n\nWorkflow: Screenshot → Analyze → Click\n\nBest practice for reliable clicking:\n\nTake screenshot\n\n/usr/sbin/screencapture -x /tmp/screen.png\n\n\nView screenshot (Read tool) to find target coordinates\n\nClick at those coordinates (1:1 on 1920x1080)\n\n/opt/homebrew/bin/cliclick c:X,Y\n\n\nVerify by taking another screenshot\n\nExample: Click a button\n# 1. Screenshot\n/usr/sbin/screencapture -x /tmp/before.png\n\n# 2. View image, find button at (850, 450)\n# (Use Read tool on /tmp/before.png)\n\n# 3. Click\n/opt/homebrew/bin/cliclick c:850,450\n\n# 4. Verify\n/usr/sbin/screencapture -x /tmp/after.png\n\nWindow Bounds\n# Get Chrome window bounds\nosascript -e 'tell application \"Google Chrome\" to get bounds of front window'\n# Returns: 0, 38, 1920, 1080  (left, top, right, bottom)\n\nCommon Patterns\nChrome Extension Icon (Browser Relay)\n\nUse AppleScript to find exact button position:\n\n# Find Clawdbot extension button position\nosascript -e '\ntell application \"System Events\"\n    tell process \"Google Chrome\"\n        set toolbarGroup to group 2 of group 3 of toolbar 1 of group 1 of group 1 of group 1 of group 1 of group 1 of window 1\n        set allButtons to every pop up button of toolbarGroup\n        repeat with btn in allButtons\n            if description of btn contains \"Clawdbot\" then\n                return position of btn & size of btn\n            end if\n        end repeat\n    end tell\nend tell\n'\n# Output: 1755, 71, 34, 34 (x, y, width, height)\n\n# Click center of button\n# center_x = x + width/2 = 1755 + 17 = 1772\n# center_y = y + height/2 = 71 + 17 = 88\n/opt/homebrew/bin/cliclick c:1772,88\n\nClicking by Color Detection\n\nIf you need to find a specific colored element:\n\n# Find red (#FF0000) pixels in screenshot\nmagick /tmp/screen.png txt:- | grep \"#FF0000\" | head -5\n\n# Calculate center of colored region\nmagick /tmp/screen.png txt:- | grep \"#FF0000\" | awk -F'[,:]' '\n  BEGIN{sx=0;sy=0;c=0}\n  {sx+=$1;sy+=$2;c++}\n  END{printf \"Center: (%d, %d)\\n\", sx/c, sy/c}'\n\nDialog Button Click\nScreenshot the dialog\nFind button coordinates visually\nClick (no scaling on 1920x1080)\n# Example: Click \"OK\" button at (960, 540)\n/opt/homebrew/bin/cliclick c:960,540\n\nType in Text Field\n# Click to focus, then type\n/opt/homebrew/bin/cliclick c:500,300\nsleep 0.2\n/opt/homebrew/bin/cliclick t:\"Hello world\"\n/opt/homebrew/bin/cliclick kp:return\n\nHelper Scripts\n\nLocated in /Users/eason/clawd/scripts/:\n\ncalibrate-cursor.sh - Calibrate coordinate scaling\nclick-at-visual.sh - Click at screenshot coordinates\nget-cursor-pos.sh - Get current cursor position\nattach-browser-relay.sh - Auto-click Browser Relay extension\nKeyboard Navigation (When Clicks Fail)\n\nGoogle OAuth and protected pages block synthetic mouse clicks! Use keyboard navigation:\n\n# Tab to navigate between elements\nosascript -e 'tell application \"System Events\" to keystroke tab'\n\n# Shift+Tab to go backwards\nosascript -e 'tell application \"System Events\" to key code 48 using shift down'\n\n# Enter to activate focused element\nosascript -e 'tell application \"System Events\" to keystroke return'\n\n# Full workflow: Tab 3 times then Enter\nosascript -e '\ntell application \"System Events\"\n    keystroke tab\n    delay 0.15\n    keystroke tab\n    delay 0.15\n    keystroke tab\n    delay 0.15\n    keystroke return\nend tell\n'\n\n\nWhen to use keyboard instead of mouse:\n\nGoogle OAuth / login pages (anti-automation protection)\nPopup dialogs with focus trapping\nWhen mouse clicks consistently fail after verification\nChrome Browser Relay & Multiple Windows\n\nProblem: Browser Relay may list tabs from multiple Chrome windows, causing snapshot to fail on the desired tab.\n\nSolution:\n\nClose extra Chrome windows before automation\nOr ensure only the target window has relay attached\n\nCheck tabs visible to relay:\n\n# In agent code\nbrowser action=tabs profile=chrome\n\n\nIf target tab missing from list → wrong window attached.\n\nVerify single window:\n\nosascript -e 'tell application \"Google Chrome\" to return count of windows'\n\nVerify-Before-Click Workflow\n\nCritical: Always verify coordinates BEFORE clicking important buttons.\n\n# 1. Take screenshot\nosascript -e 'do shell script \"/usr/sbin/screencapture -x /tmp/before.png\"'\n\n# 2. View screenshot (Read tool), note target position\n\n# 3. Move mouse to verify position (optional)\npython3 -c \"import pyautogui; pyautogui.moveTo(X, Y)\"\nosascript -e 'do shell script \"/usr/sbin/screencapture -C -x /tmp/verify.png\"'\n\n# 4. Check cursor is on target, THEN click\n/opt/homebrew/bin/cliclick c:X,Y\n\n# 5. Take screenshot to confirm action worked\nosascript -e 'do shell script \"/usr/sbin/screencapture -x /tmp/after.png\"'\n\nTroubleshooting\n\nClick lands wrong: Verify scale factor with calibration script\n\ncliclick m: doesn't move cursor visually: Use c: (click) instead, or check with cliclick p to confirm position changed\n\nPermission denied: System Settings → Privacy & Security → Accessibility → Add /opt/homebrew/bin/node\n\nWindow not found: Check exact app name:\n\nosascript -e 'tell application \"System Events\" to get name of every process whose background only is false'\n\n\nClicks ignored on OAuth/protected pages: These pages block synthetic events. Use keyboard navigation (Tab + Enter) instead.\n\npyautogui vs cliclick coordinates differ: Stick with cliclick for consistency. pyautogui may have different coordinate mapping.\n\nQuartz CGEvent clicks don't work: Some pages (Google OAuth) block low-level mouse events too. Keyboard is the only reliable method."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/EasonC13/mac-control",
    "publisherUrl": "https://clawhub.ai/EasonC13/mac-control",
    "owner": "EasonC13",
    "version": "1.0.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/mac-control",
    "downloadUrl": "https://openagent3.xyz/downloads/mac-control",
    "agentUrl": "https://openagent3.xyz/skills/mac-control/agent",
    "manifestUrl": "https://openagent3.xyz/skills/mac-control/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/mac-control/agent.md"
  }
}