Add Shortcuts to Automator

To create a shortcut on macOS that open and runs something in the terminal, you can use Automator along with System Preferences > Keyboard > Shortcuts. Here's how to achieve this:

Step 1: Create an Automator Workflow

  1. Open Automator (Search for it using Spotlight or find it in Applications).
  2. Select Quick Action as the document type.
  3. Set the following options at the top of the workflow:
    • Workflow receives: "no input" in "any application."
  4. Search for Run AppleScript in the left sidebar and drag it into the workflow area.
  5. Paste the following AppleScript:
tell application "Terminal"
    activate
    do script "echo hi" in front window
end tell
  1. Save the workflow with a descriptive name like some-name.

Step 2: Assign a Keyboard Shortcut

  1. Go to System Preferences > Keyboard > Shortcuts.
  2. Select Services in the left-hand menu.
  3. Scroll down to find the service you just created (likely under "General" or a custom section).
  4. Click on it and assign a keyboard shortcut by pressing a combination like Command + Shift + T (or another unused shortcut).