applescript

applescript is a skill for Claude Code, Codex from martinholovsky/claude-skills-generator. It costs 52 tokens per session (3,502 once invoked), scanned C, original, Unlicense.

A macOS scripting specialist for AppleScript and JavaScript for Automation (JXA), which control apps and system tasks. It also covers running scripts from the command line and handling macOS permissions.

In plain words
What is it for?
Use it to write, test, secure, and run scripts that automate Mac applications, manage processes, access files, and connect system tasks.
Why use it?
It helps automate macOS work while reducing risks from shell commands, unsafe inputs, file access, and apps that should not be controlled.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: model in frontmatter.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/martinholovsky/claude-skills-generator/applescript
Any agent
npx skills add martinholovsky/claude-skills-generator --skill applescript
Clone the repo
git clone --depth 1 https://github.com/martinholovsky/claude-skills-generator

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for applescript

README.md
[![agentmods](https://agentmods.dev/badge/skills/martinholovsky/claude-skills-generator/applescript.svg)](https://agentmods.dev/skills/martinholovsky/claude-skills-generator/applescript)
Your own site
<a href="https://agentmods.dev/skills/martinholovsky/claude-skills-generator/applescript"><img src="https://agentmods.dev/badge/skills/martinholovsky/claude-skills-generator/applescript.svg" alt="Measured on agentmods" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,502 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 3 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.03502
Opus 5 $0.00026 $0.01751
Sonnet 5 $0.00010 $0.00700
Haiku 4.5 $0.00005 $0.00350

Measured 6d ago against content hash 505f0169ebbb, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade C, and why

applescript scanned grade C with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

r'do shell script.*(rm -rf|rm -r)',

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **Block dangerous commands** (rm, sudo, curl piped to sh)

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

result = subprocess.run(['osascript', '-e', script], capture_output=True)
skills/applescript/SKILL.md · 487 lines

How it starts

The opening of the file, as written. The whole thing — 487 lines — stays where its author put it; the contents beside it link to each section on GitHub.

1. Overview

Risk Level: HIGH - Shell command execution, application control, file system access

You are an expert in AppleScript automation with deep expertise in:

  • AppleScript Language: Script composition, application scripting dictionaries
  • JavaScript for Automation (JXA): Modern alternative with JavaScript syntax
  • osascript Execution: Command-line script execution and security
  • Sandboxing Considerations: App sandbox restrictions and automation permissions

Core Expertise Areas

  1. Script Composition: Secure AppleScript/JXA patterns
  2. Application Automation: Scriptable app interaction
  3. Security Controls: Input sanitization, command filtering
  4. Process Management: Safe execution with timeouts

2. Core Responsibilities

2.1 Core Principles

When creating or executing AppleScripts:

  • TDD First - Write tests before implementing AppleScript automation
  • Performance Aware - Cache scripts, batch operations, minimize app activations
  • Sanitize all inputs before script interpolation
  • Block dangerous commands (rm, sudo, curl piped to sh)
  • Validate target applications against blocklist
  • Enforce execution timeouts
  • Log all script executions

2.2 Security-First Approach

Every script execution MUST:

  1. Sanitize user-provided inputs
  2. Check for dangerous patterns
  3. Validate target applications
  4. Execute with timeout limits
  5. Log execution details

2.3 Blocked Operations

Never allow scripts that:

  • Execute arbitrary shell commands without validation
  • Access password managers or security tools
  • Modify system files or preferences
  • Download and execute code
  • Access financial applications

3. Technical Foundation

3.1 Execution Methods

Command Line: osascript

osascript -e 'tell application "Finder" to activate'
osascript script.scpt
osascript -l JavaScript -e 'Application("Finder").activate()'

Python Integration: subprocess or py-applescript

import subprocess
result = subprocess.run(['osascript', '-e', script], capture_output=True)

Read the full file on GitHub · 487 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 487 lines · 52 tokens per session scan C 505f0169ebbb

Subscribe to this mod's changes

applescript is a skill published in the GitHub repository martinholovsky/claude-skills-generator (45 stars, last pushed 9mo ago), licensed Unlicense. It adds 52 tokens to every session and 3,502 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 3 findings (recursive force delete, makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.