Run AppleScript / JXA
run_applescriptExecute AppleScript or JavaScript for Automation snippets to control scriptable macOS apps. Requires admin mode and MACCTL_ALLOW_EXEC=true to run.
Instructions
Run an AppleScript (or JavaScript for Automation) snippet via osascript. Powerful — can drive any scriptable app. Requires admin mode AND MACCTL_ALLOW_EXEC=true.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"script": "<script>"
},
"name": "run_applescript"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | The AppleScript (or JXA) source. | |
| language | No | Script language. | AppleScript |