macOS: Eject all disks with a keyboard shortcut or the touch bar
In this post, you will first learn how to get a global shortcut and touchbar item to eject all disks connected to your MacBook at once and then learn how to create it yourself.
- Download and extract the automator script here
- Open the file and accept the installation of the quick action
- To add a global keybard shortcut, go to <System Preferences> <Keyboard> <Shortcuts> <Services> and define a shortcut for "Eject all disks"
- To make it accessible from the Touch Bar, go to <System Preferences> <Extensions> <Touch Bar> and check that "Eject all disks" is enabled. Then click on the Customize Control strip button... and add the <Quick Actions> item to your bar. After that, you can click the quick action button and select "Eject all disks" afterwards.
How it works
For people who do not trust the download above or simply want to know how it works, here's the guide:
- Open <Automator> on your Mac and create a new document with Cmd+N or <File> <New>
- Choose <Quick Action> as the document type
- For <Workflow> select <no input> in <any application>
- Select an image. Click on <Choose...>. Press Cmd+Shift+G to go to
- Drag the action <Run AppleScript> to the right panel.
- Replace the code with this AppleScript
- Save the Quick Action with name "Eject all disks"
- Folow steps 3 and 4 of quick install.