Global keyboard shortcut to eject external hard drive on Mac OSX Lion?

There is a shortcut in Finder. Select the drive in Finder and press ⌘E, which is the shortcut for File » Eject. This works for any volume (external drives, network shares, disk images).


For a global shortcut, use AppleScript. You don't even need a third party tool for a global shortcut. Open Automator.app, create a new Service, then drag Run AppleScript from the left pane.

Enter the following, and replace the name of your volume appropriately:

tell application "Finder" to eject disk "foo"

Like this:

Save it, then go to System Preferences » Keyboard » Keyboard Shortcuts, and add a global shortcut for your Service.


You can create an Automator service that ejects a specified disk.

  • Start with a Get Specified Finder Items action and drag&drop the volume from the Computer view (Cmd-Shift-C) in Finder to the list.
  • Add an Eject Disk action.

Save as any name, and assign a keyboard shortcut in System Preferences » Keyboard » Keyboard Shortcuts » Services

enter image description here