メインコンテンツまでスキップ

AppleScript & Apple Shortcuts

When built-in system settings and keyboard shortcuts are not enough, LinguaX supports two local macOS automation engines: Apple Shortcuts (available on both mouse buttons and keyboard triggers) and Custom Script (local AppleScript, available in the Keyboard shortcut editor).

All automation executes locally on your Mac — nothing is sent to a remote server.

Run Apple Shortcuts​

Apple Shortcuts lets you trigger any workflow you have built in macOS's built-in Shortcuts app — from window layouts and Focus modes to multi-step file conversions or API calls.

  • Where to bind: Available on both Mouse button/gesture mappings (under Action → Automation) and Keyboard shortcuts (Keyboard → + Add → Automation).
  • Why use it first: If your workflow already exists in Apple Shortcuts — or combines multiple macOS apps without writing AppleScript — binding an Apple Shortcut is simpler and easier to maintain than a custom script.

Setup steps​

  1. Create and test your shortcut in the macOS Shortcuts app first so any app-specific permissions are already approved.
  2. In LinguaX:
    • Mouse trigger: Open Mouse, select a button slot and gesture, open the Action menu, and choose Automation to pick your Apple Shortcut.
    • Keyboard trigger: Open Keyboard, click + Add, record a shortcut, and select your Apple Shortcut under Automation.
  3. Trigger it once in your normal workflow and approve any macOS permission prompt that appears.

Custom Script (AppleScript only)​

Custom Script runs AppleScript locally through macOS's native NSAppleScript engine.

AppleScript only — how to run shell commands

LinguaX does not run raw Bash/Zsh script files directly. If you need a shell command, call it from AppleScript with do shell script:

do shell script "/usr/bin/killall Dock"

Always use full paths to CLI binaries (for example /opt/homebrew/bin/...) because do shell script runs with a minimal PATH.

Built-in templates​

LinguaX includes three ready-to-use AppleScript templates so you can test or adapt a working pattern immediately:

TemplateWhat it doesTypical use
Restart DockRuns killall Dock to restart the macOS DockRecover a frozen Dock, Mission Control, or Stage Manager without logging out
Copy Current PathCopies the POSIX path of the active Finder window or selectionPaste folder paths straight into a terminal or editor
Clear PasteboardEmpties the macOS clipboardClear a copied password, token, or large image from clipboard memory

Safety banner and Automation permissions​

  • Risk confirmation: Before running a Custom Script, LinguaX displays a confirmation banner reminding you that scripts execute locally with your user privileges. Only run scripts you wrote or have reviewed.
  • Automation prompts: The first time a script controls another app (such as System Events, Finder, or Safari), macOS shows an Automation permission dialog. Click Allow so future triggers succeed silently.
  • If you previously clicked Don't Allow, re-enable it under System Settings → Privacy & Security → Automation → LinguaX.

Choosing between AppleScript and Apple Shortcuts​

NeedRecommended choice
Trigger from a mouse button or gestureApple Shortcuts (Custom Script is keyboard-editor only)
Fast one-liner interacting with Finder, Clipboard, or a shell CLICustom Script (AppleScript)
Multi-step workflow with macOS Focus modes, Reminders, Notes, or visual blocksApple Shortcuts
Needs a built-in macOS system action (Mission Control, screenshots, Dark Mode, Copy File Path, Open Terminal Here)Use LinguaX's built-in System Features / Finder / Developer actions first — faster and requires no script maintenance

Troubleshooting​

  • Script fails on first run: Run the same AppleScript once in macOS Script Editor to check syntax errors, then re-trigger in LinguaX and approve the macOS Automation prompt.
  • command not found in do shell script: Replace short tool names (like jq or brew) with absolute paths (/opt/homebrew/bin/jq).
  • Apple Shortcut does not appear in the picker: Open the macOS Shortcuts app once to ensure your library has synced, then reopen the LinguaX action picker.