Eject-All-Disks Shortcut for macOS

For quick un-docking of a laptop from a stationary desk setup

Robert Boscacci
3 min readJun 30, 2022

The Problem

I have several hard drives connected to my laptop’s dock. When I dock my laptop, it connects to all 2 or 3 hard drives. I want to be able to eject them all at once so that my Mac doesn’t yell at me when I un-tether from my dock.

The Fix

I created a simple hotkey combo to eject all disks using Automator and a tiny little eensy-weensy shell script.

Freeware Automator Icon from David Lanham on findicons.com

5-minute Implementation

  • Open macOS Automator
  • Create a new “Quick Action
Screenshot by author

The quick action doesn’t need to receive any input. It should simply run a shell script that ejects the disks you’d like ejected when you press your new hotkey:

Screenshot by author

The zsh script itself is very bare-bones; I am not a shell scripting wizard. For each hard drive we want ejected (my drives are called…

--

--

Robert Boscacci
Robert Boscacci

Written by Robert Boscacci

Get my book on computer vision and society for 99¢

No responses yet