How to Eject All External Partitions Quickly?

I have an external disk with two partitions on it that I keep plugged into my MacBook Pro when I'm at my desk. (One is for Time Machine, the other just for extra storage.) Sometimes I need to grab my laptop quickly and take it somewhere, but I have to change to a space where I can see the partitions on the desktop, lasso them, two-finger click, and select Eject. Is there a faster way under Mavericks, or do I have to set up an AppleScript like this one with a keyboard shortcut?

Note: I'm not looking to eject these only when I put my Mac to sleep (as explored here). Sometimes I'm on a screen-sharing telecon and I have to take my Mac away from my desk for a minute, if you know what I mean :-).


On OS-X Mountain-Lion, I can option-click one of the "Eject" icons (hold down option, then click the eject icon), and all external partitions will eject.

(Update) This has been verified to also work on OS X Mavericks and even on macOS Sierra, as I suspected it would. It can probably be assumed to work on at least all versions in between (try it out!).


The only caveat to "quickly ejecting" disks with any reliability is that they will not eject if there are files in use which reside on them. That said, you can force eject disks, but that would not be ideal if files are, in fact, in use.

Easiest way to instantly eject all disks is by invoking an Applescript (could also create a shell script, but Applescript is more easily turned into a one-click application solution).

So go to your Applescript Editor, paste in the following:

tell application "Finder" to eject (every disk whose ejectable is true and local volume is true and free space is not equal to 0)

Enter Code in your Script Editor

and save the script as an application wherever you choose (do NOT use the /tmp folder as illustrated). Add the resulting application to your Dock, and you have a one-click Quick Eject.

Select 'Application' as your file format

Note: the and free space is not equal to 0 portion is so that the script doesn't eject the contents of your CD/DVD drive. Remove that if you would like any inserted disks ejected as well.