Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tjb1

macrumors 68000
Original poster
Aug 26, 2010
1,999
0
Pennsylvania, USA
I have an external superdrive now and im trying to make the eject button eject it. I got KeyRemap4Macbook and I clicked the one that says "Eject to Command+Control+Option+Shift+E" which I assume means pressing Eject now activates the key sequence Command+Control+Option+Shift+E.

I now made a Shell Script

diskutil listdisk
diskutil eject disk2(my superdrive)

Problem now is I tried "Watch Me Do" and that doesnt work. I cant figure out how to make the script run when "Command+Control+Option+Shift+E" is pressed.

Can anyone help with this??
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
I haven't tried this, but you could most probably use automator and the action, run shell script. Then save it as a service.

Now go to system prefs/keyboard, chose services, and set the key combo you would like.
 

tjb1

macrumors 68000
Original poster
Aug 26, 2010
1,999
0
Pennsylvania, USA
I did that, but its not listed as a service in Finder. The shortcut itself doesnt work and the Eject button doesnt work.

Its listed under Text in Services if that means anything...

If I click on something and highlight the text, the shortcut ejects the cd but not the eject button.
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Hm, that's odd. Most of my Services shows up under "Services/files and folders" in system preferences. But they are dealing with files and folders of course.

But even the ones dealing with text like one called 'sort selected paragraph' lets me add a keyboard shortcut, by just double clicking it. Not sure how that would work though since it's dependent on a text selection to do it's work.
 

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Wait, open your the service in Automator. What is your input method?

I'm pretty sure it defaults to 'selected text from any program' or something of that nature. You have to change this to 'no input'.
 

tjb1

macrumors 68000
Original poster
Aug 26, 2010
1,999
0
Pennsylvania, USA
The eject button now works to eject the external drive, thank you!

Now is there anyway I can make this service only eject a cd/dvd drive?

I see in diskutil eject it shows quite a few options for how/what to eject but I dont know how to apply those.
 

tjb1

macrumors 68000
Original poster
Aug 26, 2010
1,999
0
Pennsylvania, USA
I think I found it by using "drutil eject" instead of "diskutil list and diskutil eject xxx" Testing this now with multiple devices plugged in and on restart.

It works great, had a hub along with 4 flash drives plugged in and it ejected fine using drutil eject so now drive identification doesnt matter, it will just eject media drives.

Thank you so much subsonix.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.