run_osascript
Execute AppleScript or JXA scripts on macOS to automate any scriptable app, adjust system settings, and manage files with multiline script support.
Instructions
Execute an AppleScript or JXA (JavaScript for Automation) script on macOS. Automate any scriptable app, control system settings, manage files, and more. Supports multiline scripts. Use language='javascript' for JXA. Timeout: 30s default, max 120s. Max script: 50 KB. Output is truncated at 50000 characters.
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_osascript"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | The script source code to execute. | |
| timeout | No | Timeout in seconds (1-120). Default: 30. | |
| language | No | Script language. | applescript |