💬 观点Simon Willison
Count the number of Safari tabs — 用一行 AppleScript 统计 Safari 标签页数量,极简实用。
用一行 AppleScript 统计 Safari 标签页数量,极简实用。
2026-06-29原文
本文为要点摘要,完整细节以原文为准。
- 使用
osascript -e 'tell application "Safari" to count tabs of every window'即可获取每个窗口的标签页数。 - 该命令返回每个窗口的标签页数列表,而非总数,适合快速查看分布。
- 对开发者而言,这种小技巧展示了 AppleScript 在浏览器自动化中的潜力,可扩展为更复杂的标签管理脚本。
原文:Count the number of Safari tabs · 作者 Simon Willison