mac-automation
БесплатноБез исполняемых скриптовНе проверенThis skill should be used when the user requests Mac automation via AppleScript, including: Mail operations, Reminders/Calendar management, Safari control…
Об этом скилле
Mac Automation via AppleScript
This skill enables control of macOS applications and system functions through AppleScript execution via the osascript command.
Core Principle
Execute AppleScript commands using the Bash tool with osascript:
osascript -e 'AppleScript code here'
For multi-line scripts:
osascript <<'EOF'
tell application "App Name"
-- commands here
end tell
EOF
Supported Applications & Functions
1. Mail (邮件)
- Send emails with subject, body, recipients
- Read unread emails
- Search emails
- Create drafts
2. Reminders (提醒事项)
- Create reminders with due dates
- List reminders by list
- Complete/delete reminders
- Create reminder lists
3. Calendar (日历)
- Create events with time, location, notes
- List today's/upcoming events
- Delete events
- Create calendars
4. Notification Center (通知中心)
- Display system notifications
- Custom title, subtitle, message
- Sound alerts
5. Safari
- Open URLs
- Get current page info
- Execute JavaScript
- Manage tabs and windows
6. Finder
- Open folders
- Get/set file info
- Move, copy, delete files
- Create folders
- Reveal files
7. System Controls (系统控制)
- Volume control (mute, set level)
- Brightness (via external tools)
- Open applications
- System info queries
- Sleep/restart/shutdown (with care)
8. Third-Party Applications
Many third-party apps support AppleScript. Common categories include development tools (iTerm2, VS Code), task management (OmniFocus, Things), media players (Spotify), browsers (Chrome), and communication tools. To check if an app supports AppleScript, open Script Editor to browse its dictionary, or try basic commands like tell application "AppName" to get name.
Execution Guidelines
Security Considerations
Permission Prompts: First-time use of certain apps triggers macOS permission dialogs. Inform user if automation fails due to permissions.
Sensitive Operations: For destructive operations (delete, shutdown), confirm with user before executing.
Privacy-Sensitive Data: When reading emails or calendar events, only display what user explicitly requests.
Error Handling
Common errors and solutions:
"Application not found"→ Check app name spelling"Not authorized"→ Guide user to System Preferences > Privacy & Security"Can't get..."→ Resource doesn't exist, handle gracefully
Best Practices
- Use exact app names: "Mail", "Reminders", "Calendar", "Safari", "Finder"
- Escape special characters: Use
\"for quotes in strings - Handle Unicode: AppleScript handles Chinese/Unicode natively
- Check app state: Some operations require app to be running
Quick Reference
Notifications
osascript -e 'display notification "消息内容" with title "标题"'
Open Application
osascript -e 'tell application "AppName" to activate'
Volume Control
# Get volume
osascript -e 'output volume of (get volume settings)'
# Set volume (0-100)
osascript -e 'set volume output volume 50'
# Mute
osascript -e 'set volume output muted true'
System Commands
# Get clipboard
osascript -e 'the clipboard'
# Set clipboard
osascript -e 'set the clipboard to "text"'
Additional Resources
Reference Files
For detailed AppleScript patterns by application, consult:
references/mail-applescript.md- Email operations: send, read, search, draftsreferences/reminders-applescript.md- Reminder operations: create, list, completereferences/calendar-applescript.md- Calendar operations: events, calendarsreferences/safari-applescript.md- Safari operations: URLs, tabs, JavaScriptreferences/finder-applescript.md- Finder operations: files, foldersreferences/system-applescript.md- System controls: volume, apps, clipboard
Example Files
Working examples in examples/:
daily-briefing.applescript- Get today's calendar and unread emailsquick-note.applescript- Create reminder from clipboard
Utility Scripts
Scripts in scripts/:
run-applescript.sh- Wrapper for safe AppleScript execution
Workflow Patterns
Pattern 1: Information Retrieval
- Execute AppleScript to query data
- Parse output
- Present formatted results to user
Pattern 2: Action Execution
- Confirm action with user if destructive
- Execute AppleScript
- Verify success
- Report result
Pattern 3: Multi-App Automation
- Chain multiple AppleScript calls
- Pass data between calls using shell variables
- Handle errors at each step
Common User Requests
| User Request | Action |
|---|---|
| "发送邮件给xxx" | Use Mail to create and send |
| "提醒我明天..." | Create Reminder with due date |
| "添加日历事件" | Create Calendar event |
| "打开xxx网站" | Safari open URL |
| "调低音量" | Set volume lower |
| "显示通知" | Display notification |
| "打开文件夹" | Finder reveal |
Troubleshooting
If AppleScript fails:
- Check a
Установить mac-automation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл mac-automation?
This skill should be used when the user requests Mac automation via AppleScript, including: Mail operations, Reminders/Calendar management, Safari control, Finder operations, system controls (volume, brightness, notifications, app launching), third-party apps (development tools, task management, media players), or mentions "AppleScript" or "automate Mac".
Как установить скилл mac-automation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл mac-automation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic