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

flowrider

macrumors 604
Original poster
Nov 23, 2012
7,323
3,003
I don't use an Mac KB so no eject key. Prior to Catalina the F12 key acted as the eject key. That ended in Mojave. However the eject key remained in the "Menu Bar". With Big Sur that option still appears in "CDs & DVDs" but the eject button does not appear in the "Menu Bar". I use an external CD/DVD player/recorder with my 7,1 NcMP. Anybody have a solution?

Lou
 

OkiRun

macrumors 65816
Oct 25, 2019
1,005
585
Japan
I don't use an Mac KB so no eject key. Prior to Catalina the F12 key acted as the eject key. That ended in Mojave. However the eject key remained in the "Menu Bar". With Big Sur that option still appears in "CDs & DVDs" but the eject button does not appear in the "Menu Bar". I use an external CD/DVD player/recorder with my 7,1 NcMP. Anybody have a solution?

Lou

If you select the optical disc in the OS X Finder and press Command-E, the disc will eject. ...
Is that what you mean?
 

flowrider

macrumors 604
Original poster
Nov 23, 2012
7,323
3,003
^^^^OK that works for one time. Wont close the cover. It's certainly a clumsy way. There has to be something else ?

Lou
 

flowrider

macrumors 604
Original poster
Nov 23, 2012
7,323
3,003
I did some research and found the "menu extras" folder in "core services". Clicked on "eject menu" and "eject" was not added to the "menu bar". Now I remember that's what I did in Catalina. A No-Go in Big Sur. I see a couple of applets in the app store. I'll try one. Shouldn't have to do that though.

Lou
 

flowrider

macrumors 604
Original poster
Nov 23, 2012
7,323
3,003
Well I just downloaded a couple of applets from the App Store and a No-Go. Right now the only way I can open the door on the drive is from the unit itself or from the eject button in "Toast". A real bummer ?

The refund mechanism at the App Store is another convoluted piece of crap?

Lou
 

Wowfunhappy

macrumors 68000
Mar 12, 2019
1,747
2,091
Well I just downloaded a couple of applets from the App Store and a No-Go. Right now the only way I can open the door on the drive is from the unit itself or from the eject button in "Toast". A real bummer ?

The refund mechanism at the App Store is another convoluted piece of crap?

Lou

What if you used Applescript?

First, open Utilities → Script Editor and open Preferences. In the General tab, check "Show Script menu in menu bar" and uncheck "Show Computer scripts".

Then, paste the following code into the script editor:
AppleScript:
do shell script "/usr/bin/drutil eject"

And save your script to [Your User Folder]/Library/Scripts with a name like "Open CD Tray".

Now, you can make a second script with the code:
AppleScript:
do shell script "/usr/bin/drutil tray close"

And save it in the same location as above, but name it something like "Close CD Tray".

You should now be able to open and close the tray from the script icon in your menu bar!
 

flowrider

macrumors 604
Original poster
Nov 23, 2012
7,323
3,003
^^^^I guess I don't know what I am doing. I kept getting a syntax error.

Lou
 

OkiRun

macrumors 65816
Oct 25, 2019
1,005
585
Japan
Lou `
You are not talking about the Apple SuperDrive I guess since you have a tray to eject... This is what I didn't understand. Sorry.
 

Wowfunhappy

macrumors 68000
Mar 12, 2019
1,747
2,091
^^^^I guess I don't know what I am doing. I kept getting a syntax error.

Lou

Okay, let's try it this way.

I made the scripts for you. Copy them to [your user folder]/Library/Scripts.

You should now have options to open and close your CD tray when you click the script icon in your menu bar.
 

Attachments

  • CD Tray Scripts.zip
    1.9 KB · Views: 219
Last edited:

flowrider

macrumors 604
Original poster
Nov 23, 2012
7,323
3,003
Lou `
You are not talking about the Apple SuperDrive I guess since you have a tray to eject... This is what I didn't understand. Sorry.

I have an external Asus CD/DVD player/burner.

Lou
 

Wowfunhappy

macrumors 68000
Mar 12, 2019
1,747
2,091
Thank Yew ? ? ? ? It works.

You're welcome, glad to hear it! I love Applescript! Kind of sad to hear people are actually selling apps to do this (even sadder that they don't actually work).

I do wonder why you were getting errors the first time when you copy pasted the code, but oh well...
 
  • Like
Reactions: OkiRun

OkiRun

macrumors 65816
Oct 25, 2019
1,005
585
Japan
You're welcome, glad to hear it! I love Applescript! Kind of sad to hear people are actually selling apps to do this (even sadder that they don't actually work).

I do wonder why you were getting errors the first time when you copy pasted the code, but oh well...
Sorry to ask a question when solved ~
Will this code work for all external CD/DVD players including SuperDrive? Is it device independent?
Thanks for any response.
 

flowrider

macrumors 604
Original poster
Nov 23, 2012
7,323
3,003
^^^^From what I see, it's universal. Wowfunhappy had no idea of my setup. But why not try it for your situation and see if it works for you?

Lou
 
  • Like
Reactions: OkiRun

OkiRun

macrumors 65816
Oct 25, 2019
1,005
585
Japan
^^^^From what I see, it's universal. Wowfunhappy had no idea of my setup. But why not try it for your situation and see if it works for you?

Lou

1) I followed the sequence of steps
2) Attach the SuperDrive from Apple
3) Insert old Quartermass The Pit DVD from closet
4) Make sure Script is in menu bar
4) Click Open CD Tray
5) It worked!

First time using scripts. Thanks for all information. :)
 

Wowfunhappy

macrumors 68000
Mar 12, 2019
1,747
2,091
Since I'm apparently teaching people about the Scripts folder for the first time, I'll add a few more details. The system isn't magic and you shouldn't be afraid to touch it in the future.

The menu bar mirrors the contents of your Library/Scripts/ folder. If you had lots of Applescripts for different functionality (as I do), you could arrange them in subfolders, and they'll be arranged in the menu bar as well:

Screen Shot 2020-08-08 at 9.20.59 AM.png


(Yes, I'm running Mavericks, so the visuals are a bit different.)

The one exception is the "Applications" subfolder, which is special! I have some scripts that are specific to QuickTime Player. So, I created a folder in Library/Scripts/Applications/ called "QuickTime Player", and put QuickTime-specific scripts there.

Screen Shot 2020-08-08 at 9.25.09 AM.png

And these scripts will only show up in the menu bar if QuickTime is in focus:

Screen Shot 2020-08-08 at 9.26.33 AM.png


It's really a great system! I only wish Applescript hadn't been neutered somewhat in Mojave. (This is, in fact, one of the reasons I'm on Mavericks.)
 

flowrider

macrumors 604
Original poster
Nov 23, 2012
7,323
3,003
^^^^Thanks for all info. Would it be possible to program an F key to do act as an eject button? As I posted above, in the past, before Catalina, the F12 key acted as an eject key on non Apple KBs.

Lou
 

Wowfunhappy

macrumors 68000
Mar 12, 2019
1,747
2,091
^^^^Thanks for all info. Would it be possible to program an F key to do act as an eject button? As I posted above, in the past, before Catalina, the F12 key acted as an eject key on non Apple KBs.

Yes and no—macOS has a system for this, but it's not the one that I just explained. Instead of just saving a script in the Scripts folder, you need to use Automator to create a service (aka "Quick Action") which contains the script.

Then, you can assign the service to a keyboard shortcut in System Preferences → Keyboard → Shortcuts → Services.

Take a look at Automator and see if you can figure it out—the interface can seem a little intimidating on first glance, but once you parse everything it's actually somewhat self-explanatory...
 

flowrider

macrumors 604
Original poster
Nov 23, 2012
7,323
3,003
I did some research and found the "menu extras" folder in "core services". Clicked on "eject menu" and "eject" was not added to the "menu bar". Now I remember that's what I did in Catalina. A No-Go in Big Sur. I see a couple of applets in the app store. I'll try one. Shouldn't have to do that though.

Just to add here - In Big Sur Beta 11, eject is available again ?

Lou
 
  • Like
Reactions: OkiRun
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.