Press a key or shortcut
ui_press_keySend keyboard shortcuts or named keys to a background macOS app, triggering menu commands or posting input without bringing the app to the front. Set front mode only if the app ignores background input.
Instructions
Send a keyboard shortcut to an app in the background: a shortcut with command, control or option that belongs to a menu item presses that item (a hidden app ignores posted shortcuts); other keys are posted to the app's process. Pass front: true if an app ignores it. E.g. key "e" with ["command"], key "b" for the Blade tool, or named keys: return, enter, tab, space, delete, escape, left, right, up, down, home, end, pageup, pagedown, f1–f12.
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": {
"app": "<app>",
"key": "<key>"
},
"name": "ui_press_key"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | Yes | App to control: finalcut, motion, logic, mainstage, compressor, pixelmator, keynote, pages, numbers, or any other app name, bundle ID or .app path | |
| key | Yes | ||
| front | No | Bring the app to the front first. Off by default: apps are driven in the background so the user's screen isn't taken over. | |
| modifiers | No |