Eject a CD from the SuperDrive on my Mac mini

My Magic Keyboard w/ Touch ID has no Eject key, apparently because modern iMacs have no internal optical drive.

I'd like to create a KM macro to turn my keyboard's F18 key into an Eject key for the Apple SuperDrive on my Mac mini. My first attempt was to create a macro with this single action:

Simulate the Hardware Key Eject

But that macro has no effect on my SuperDrive. To verify I'd set F18 to trigger the macro, I inserted a "System Beep" step before the Eject action.

I'm running Keyboard Maestro 11.0.3 on Sonoma 14.5.

Run this command in Terminal with a disk inserted:

drutil tray eject

Does it work? (It works on my modern Mac with an external CD-R drive, but not sure about internals in older Macs.)

If so, write a simple macro with an Execute a Shell Script action to run that command.

-rob.

1 Like

Rob, I missed your reply back in June.

I'm very pleased to report the Terminal command in my updated Eject CD macro works great!

Note: The non-working "Simulate the Hardware Key Eject" step is disabled.

Glad to hear it works!

-rob.