Eject-All-Disks Shortcut for macOS
For quick un-docking of a laptop from a stationary desk setup
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.
5-minute Implementation
- Open macOS Automator
- Create a new “Quick Action”
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:
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…