Findmy
通過 macOS 上的 FindMy.app,使用 AppleScript 和屏幕截圖來追蹤 Apple 設備和 AirTag。
技能元數據
| 來源 | 捆綁(默認安裝) |
| 路徑 | skills/apple/findmy |
| 版本 | 1.0.0 |
| 作者 | Hermes Agent |
| 許可證 | MIT |
| 平臺 | macos |
| 標籤 | FindMy, AirTag, location, tracking, macOS, Apple |
參考:完整 SKILL.md
信息
以下是觸發此技能時 Hermes 加載的完整技能定義。這是技能激活時代理所看到的指令。
Find My (Apple)
通過 macOS 上的 FindMy.app 追蹤 Apple 設備和 AirTag。由於 Apple 未為 FindMy 提供命令行界面 (CLI),此技能使用 AppleScript 打開應用,並通過屏幕截圖讀取設備位置。
前提條件
- macOS,已安裝 Find My 應用並登錄 iCloud
- 設備/AirTag 已在 Find My 中註冊
- 終端需具備屏幕錄製權限(系統設置 → 隱私與安全性 → 屏幕錄製)
- 可選但推薦:安裝
peekaboo以獲得更好的 UI 自動化支持:brew install steipete/tap/peekaboo
何時使用
- 用戶詢問“我的 [設備/貓/鑰匙/包] 在哪裡?”
- 追蹤 AirTag 位置
- 檢查設備位置(iPhone、iPad、Mac、AirPods)
- 監控寵物或物品隨時間的移動軌跡(AirTag 巡邏路線)
方法 1:AppleScript + 截圖(基礎)
打開 FindMy 並導航
# Open Find My app
osascript -e 'tell application "FindMy" to activate'
# Wait for it to load
sleep 3
# Take a screenshot of the Find My window
screencapture -w -o /tmp/findmy.png
然後使用 vision_analyze 讀取截圖:
vision_analyze(image_url="/tmp/findmy.png", question="What devices/items are shown and what are their locations?")
切換標籤頁
# Switch to Devices tab
osascript -e '
tell application "System Events"
tell process "FindMy"
click button "Devices" of toolbar 1 of window 1
end tell
end tell'
# Switch to Items tab (AirTags)
osascript -e '
tell application "System Events"
tell process "FindMy"
click button "Items" of toolbar 1 of window 1
end tell
end tell'
方法 2:Peekaboo UI 自動化(推薦)
如果已安裝 peekaboo,請使用它進行更可靠的 UI 交互:
# Open Find My
osascript -e 'tell application "FindMy" to activate'
sleep 3
# Capture and annotate the UI
peekaboo see --app "FindMy" --annotate --path /tmp/findmy-ui.png
# Click on a specific device/item by element ID
peekaboo click --on B3 --app "FindMy"
# Capture the detail view
peekaboo image --app "FindMy" --path /tmp/findmy-detail.png
然後通過視覺模型進行分析:
vision_analyze(image_url="/tmp/findmy-detail.png", question="What is the location shown for this device/item? Include address and coordinates if visible.")
工作流:隨時間追蹤 AirTag 位置
用於監控 AirTag(例如,追蹤貓的巡邏路線):
# 1. Open FindMy to Items tab
osascript -e 'tell application "FindMy" to activate'
sleep 3
# 2. Click on the AirTag item (stay on page — AirTag only updates when page is open)
# 3. Periodically capture location
while true; do
screencapture -w -o /tmp/findmy-$(date +%H%M%S).png
sleep 300 # Every 5 minutes
done
使用視覺模型分析每張截圖以提取座標,然後彙總成路線。
限制
- FindMy 沒有 CLI 或 API — 必須使用 UI 自動化
- AirTag 僅在 FindMy 頁面主動顯示時更新位置
- 位置精度取決於 FindMy 網絡中附近的 Apple 設備
- 截圖需要屏幕錄製權限
- AppleScript UI 自動化可能在不同 macOS 版本間失效
規則
- 追蹤 AirTag 時保持 FindMy 應用在前臺(最小化時會停止更新)
- 使用
vision_analyze讀取截圖內容 — 不要嘗試解析像素 - 對於持續追蹤,使用 cronjob 定期捕獲並記錄位置
- 尊重隱私 — 僅追蹤用戶擁有的設備/物品