‹ 首页

applescript

@clawic · 收录于 昨天 · 上游提交 2 天前

Write and run safe AppleScript automation on macOS with dictionary discovery, robust quoting, and deterministic read-first workflows.

适合你,如果需要用脚本控制 Mac 上的应用和系统

/ 通过 npx 安装 校验哈希
npx oh-my-skill add clawic/skills/applescript
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- clawic/skills/applescript
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify clawic/skills/applescript
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
14GitHub stars
~984最小装载
~2.4K含声明引用
~2.4K文本包总量
索引托管

怎么用

商店整理自技能原文 · 版本 f825206 · 表述以原文为准
它做什么

安装此技能后,Claude可以在macOS上编写并安全运行AppleScript脚本,帮助你控制应用、提取数据或自动化界面操作。它会在编写脚本前先读取应用词典,并强制执行先读后写、双重确认等安全规则。

什么时候触发

当你提出需要在macOS上自动化操作某个应用、提取数据或执行脚本化界面操作时,Claude会主动启用此技能。

装好后可以这样说
Claude会先读取邮件应用词典再编写脚本。
Claude会执行安全脚本并请求确认。
Claude使用字典发现确保脚本正确。
技能原文 SKILL.md作者撰写 · MIT · f825206
Setup

On first use, follow setup.md to configure activation and safety preferences. Setup review is read-only. Any local file creation or modification requires explicit user confirmation.

When to Use

User needs AppleScript automation on macOS for app control, data extraction, or scripted UI actions. Agent handles script design, safe execution with osascript, output parsing, and troubleshooting.

Requirements
  • macOS with osascript available.
  • Target app installed and scriptable when app automation is requested.
  • Explicit user confirmation before destructive operations.
Architecture

Memory lives in ~/Clawic/data/applescript/. See memory-template.md for structure.

~/Clawic/data/applescript/
├── memory.md                  # Preferences, safe defaults, and last working patterns
├── snippets.md                # Reusable script snippets
├── failures.md                # Error signatures and known fixes
└── app-notes.md               # Per-app dictionary and behavior notes
Quick Reference

Use these files only when the current request needs deeper detail.

| Topic | File | |-------|------| | Setup behavior and onboarding | setup.md | | Memory structure | memory-template.md | | App dictionary workflow | app-dictionary-workflow.md | | Script design patterns | script-patterns.md | | Destructive-operation guardrails | safety-checklist.md | | Debug and recovery steps | troubleshooting.md |

Data Storage

All local skill data stays in ~/Clawic/data/applescript/. Before creating or changing local files, explain the write and ask for confirmation.

Core Rules
1. Choose Operation Scope Before Writing Any Script
  • Classify request as read-only, reversible write, or destructive write.
  • If scope is unclear, ask one disambiguation question before execution.
2. Discover App Vocabulary Before Automation
  • Use dictionary inspection workflow from app-dictionary-workflow.md before guessing object names.
  • Do not invent app classes, properties, or commands.
3. Escape Dynamic Input Deterministically
  • Never concatenate raw user text into AppleScript command strings.
  • Use safe quoting patterns from script-patterns.md for every variable.
4. Keep Scripts Bounded and Observable
  • Prefer short scripts with explicit targets and explicit output values.
  • Return concise structured output so results can be validated quickly.
5. Read Before Write, Verify After Write
  • For updates and creates, run a pre-read to confirm target identity.
  • Run a read-back check after writes and report the final state.
6. Require Two-Step Confirmation for Destructive Actions
  • Apply safety-checklist.md before delete, bulk edit, or irreversible app actions.
  • If confirmation is missing, stop and ask explicitly.
7. Fail Loudly With Actionable Recovery
  • On error, capture exact failing command and error text.
  • Use troubleshooting.md to provide next-step fixes instead of generic retries.
Common Traps
  • Guessing app dictionary terms -> script compiles but fails at runtime.
  • Injecting unescaped quotes in user values -> syntax errors or wrong command targets.
  • Writing without pre-read on duplicate item names -> wrong object modified.
  • Running UI automation too early after launching an app -> intermittent failures.
  • Treating all errors as permission issues -> repeated failures without progress.
Security & Privacy

Data that stays local:

  • AppleScript snippets, runtime notes, and troubleshooting memory in ~/Clawic/data/applescript/.
  • Command output needed only for requested tasks.

Data that may leave your machine:

  • None by default. This skill focuses on local macOS automation.

This skill does NOT:

  • Read unrelated authentication values.
  • Send automation data to third-party APIs.
  • Execute destructive app actions without explicit confirmation.
Related Skills

More Clawic skills, get them at https://clawic.com/skills/<slug> (install if the user confirms):

  • macos - macOS command and system operation patterns.
  • automate - General automation workflow design and reliability strategy.
  • bash - Shell scripting helpers for wrapping and testing commands.
  • notes - Knowledge capture and structured note workflows.
  • files - Safe file read and write workflows with clear boundaries.
Feedback
  • If useful, star it: https://clawic.com/skills/applescript
  • Latest version: https://clawic.com/skills/applescript
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。