跳到主要内容

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'

如果已安装 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 版本间失效

规则

  1. 追踪 AirTag 时保持 FindMy 应用在前台(最小化时会停止更新)
  2. 使用 vision_analyze 读取截图内容 — 不要尝试解析像素
  3. 对于持续追踪,使用 cronjob 定期捕获并记录位置
  4. 尊重隐私 — 仅追踪用户拥有的设备/物品