macOS: Keyboard-Based Shutdown - via Spotlight

Jun 2, 2026 20:00 · 93 words · 1 minute read

Alfred has a built-in feature to trigger system actions like shutdown, restart or lock directly from its search bar. Spotlight didn’t have this out of the box – now, with the recently revamped Spotlight & with a small AppleScript trick, you can add it yourself.

  1. Open the Shortcuts app and create a new shortcut.
  2. Add a “Run AppleScript” action and enter the following script:
1
2
3
tell application "Finder"
    shut down
end tell
  1. Give the shortcut a descriptive name (e.g. “Shutdown”).
  2. Open Spotlight (Command + Space), type “Shutdown” – done.

via saschadiercks.de