Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Using Eject Button with External SuperDrive

Does anyone know a terminal file edit that will allow the eject button to function for an external SuperDrive? The eject button is currently useless and seems such a waste. Thanks

MacBook Pro, Mac OS X (10.7.4)

Posted on Aug 15, 2012 8:59 AM

Reply
18 replies

Aug 29, 2012 7:56 PM in response to kickinchef247

After searching and searching, I found a solution. I took this from the following link, I will quote it here:

http://forums.macrumors.com/showthread.php?t=1073018


This works on 10.8 as well.


"What you will need:

KeyRemap4Macbook - Works for Lion, Snow Leopard, Leopard, and Tiger.

Steps:

1. Download and install KeyRemap4Macbook. Restart is required for use.

2. Open System Preferences > KeyRepma4Macbook

3. Make sure you are on the "Change Key" menu and click in the search bar in KeyRemap4Macbook, not the search for System Preferences.

4. Type "eject" in the search bar and check the box next to "Eject to Command+Control+Option+Shift+E"

5. Exit System Preferences and open Automator.

6. Choose the template "Service" and hit "Choose" at the bottom right.

7. In the search bar at the top left, type "Run Shell Script"

8. Drag "Run Shell Script" from the left to the Workflow Area.

9. At the top above "Run Shell Script" click the arrows next to "Service receives selected text" and pick "no input" at the bottom of the list.

10. Next delete "cat" from the Shell Script and type this "drutil eject"

11. While in Automator go File > Save As > Eject

12. Close Automator and open System Preference > Keyboard > Keyboard Shortcuts

13. In Keyboard Shortcuts choose Services in the left box.

14. In the right, scroll down to "General" and you should see "Eject" listed.

15. Make sure the box beside "Eject" is marked and double click on the right side just to the left of the scroll bar.

16. This should bring up a textbox, in this box type "Command+Control+Option+Shift+E"

17. After you do that it should close the box and you will then see the key combination listed beside "Eject"

18. Close System Preferences and the Eject key should now eject your external cd/dvd drive."

Aug 30, 2012 12:01 AM in response to lennoxx

Thank you lennoxx.

This worked in Mountain Lion with a couple changes:



in [11] there is no longer a "Save As" - used "Save ..." instead.


That created ~/Library/Services/Eject.workflow which did not appear in [14], even after a reboot.



Copied it to /System/Library/Services/ which did work after yet another reboot.

May 20, 2013 9:11 PM in response to kickinchef247

I love it! Thank you so much this has fixed my issue. I removed the dvd drive and installed an additional HDD in its place. I considered purchasing a new dvd player but I had this perfectly good one, so I purchased an enclosure so I could still use it. After a little tinkering I was able to get the player to read movies but I could not get the eject button work. Your post walked me right through the steps of doing it and it was super easy. Thank you so much. 🙂

Aug 23, 2013 7:56 PM in response to Community User

Ok so I have tried this process three times now with no sucess. I am running 10.8.4 on my MacBook Pro and I also took the SuperDrive out of it just lilke ERLDroid.


I was able to make the DVD Player App work by applying this patch:

[SOLVED] Valid DVD Drive could not be found -70012 - Mountain Lion


The patch makes the Eject button work that is within the DVD Player App but not the one on the keyboard.


I have also tried what "zit" did but that didn't help.



Does anyone have any suggestions?



And I noticed that on Mountian Lion 10.8.4, Step 2 is wrong. There are no KeyRemap4MacBook prefrences in the System Prefrences. To get to the KeyRemap4macBook Prefrences you have to click on the icon in the menu bar and click on "Prefrences..." there. And when in the keyboard prefrences and setting the shortcut in Step 16 you can't type in the keys but you have to press them simultaneously.

Jan 5, 2014 2:56 PM in response to kickinchef247

Thanks a lot lennox!


Note that the automator script is not necessary! KeyRemap4Macbook XML can be easily customized in order to have Eject key functioning for external drive as a custom setting! (Tested on OS X 10.9.1, KeyRemap4MacBook version 9.2.0)


What you need:


KeyRemap4Macbook - Works for Lion, Snow Leopard, Leopard, and Tiger.


Steps:


1. Download and install KeyRemap4Macbook. Restart is required for use.


2. Open KeyRemap4Macbook from Launchpad, Applications or the Menu Bar icon.


3. Open "Misc & Uninstall" tab and click "Open private.xml" button, a Finder window is opened.


4. Open private.xml with your preferred text editor.


5. If you have not already edited private.xml by your own (otherwise, you already know what to do), clear all the content and copy-paste this code:


<?xml version="1.0"?>

<root>

<item>

<name>Change Eject Key :: Extras</name>

<!-- define Custom Key: launch shell command -->

<vkopenurldef>

<name>KeyCode::VK_OPEN_URL_SHELL_eject_externaldrive</name>

<url type="shell">

<![CDATA[ drutil eject -drive external ]]>

</url>

</vkopenurldef>

<!-- define custom item: Eject To Custom Key -->

<item>

<name>Make Eject key work for external drive</name>

<identifier>remap.eject2eject4externaldrive</identifier>

<autogen>

__ConsumerToKey__

ConsumerKeyCode::EJECT,

KeyCode::VK_OPEN_URL_SHELL_eject_externaldrive

</autogen>

</item>

</item>

</root>


6. Save private.xml and exit editor.


7. Open "Change Key" tab in KeyRemap4Macbook and press "ReloadXML" button.


8. As first line in the "remapping" list "Change Eject Key :: Extras" has appeared, open it and check the box next to "Make Eject key work for external drive".


9. Done. Eject key should now eject your external cd/dvd drive.


Thanks to pqrs for their great tool!

Apr 12, 2014 9:43 PM in response to kickinchef247

I went a different way after reading this article on CNET: http://www.cnet.com/news/ejecting-external-optical-drives-in-os-x/


The good thing is that there's a way now to close the tray.


Everything below was done in 10.9.2 and works fine with an extended wireless Logitech keyboard (old, S530 Mac) and an OWC external Blu-Ray connected through USB3 (bought a month ago).


In Automator create a New Service. For "Service receives selected", choose "no input". Drag "Run Shell Script" in the main window. Replace the word "cat" by "drutil eject -drive external". Save the workflow by naming it "Eject External Disc" or any name you like.

To close the tray from the keyboard create a new workflow and choose "Service" again. Choose "no input" for "Service receives selected". Drag "Run Sell Script" to the main window but this time replace the word "cat" by "drutil tray close". Save it by naming it "Close Tray" or wathever name you like.


Then go to System Preferences and open the Keyboard preference pane. Go to Services and click on the 1st Service you just created. You then see "add shortcut" to the right. Fill in your favorite key combination. Find the other Service (close tray) and again choose your favorite key combination.


I went that way because I prefer to add as few additions as possible to the System. It's been tested with a few applications and it works in Safari, TextEdit, iTunes, Adobe Reader. Here I had to use option-command-shift-F15 to open and option-command-shift-F14 to close because most other letters and symbols are already used in Photoshop and that was the only combinations succesfully tested. It's possible that it won't work from every program but then clicking on the desktop to go back to the Finder brings the open/close tricks back.


Hope it works for as many of you as possible.

Jun 29, 2014 6:10 PM in response to lennoxx

This worked like a charm!


2013 iMac with Mavericks and a wireless keyboard. Eject button was unresponsive, but the external drive interacted with the OS in every other way (ejected from finder, etc.), so I'm not too clear on WHY this was happening, but this tip fixed everything and my eject button works now! Silly little non-vestigial button.


Also, you can force your display to sleep by pressing control-shift-eject...so it has another use.

Using Eject Button with External SuperDrive

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.