My keyboard doesn't have the Eject key. Yet I've always used the ⌃-Eject combination to show the Sleep/Restart/Shutdown window on previous Macs. I want to simulate the key press by typing a different keyboard combination so that (hopefully) macOS will show me that window.
You can always use the combination: "control+power button" to access this dialog box. If you are using a mac mini like me, this shortcut will however not be of much use to you.
I don't know if there is a way to create a shortcut button which will emulate either the eject or shut down button. I tried various different things like a keyboard shortcut for the power button and an automator workflow for the eject function but without any success so far.
this is no longer supported by the newer Macs. I solved this with an apple script. I found it online but can't remember the source. The display dialog command only supports three buttons, so one must be omitted. Pick your poison... in this example "restart ´" is not active. You can run the script with "Run Apple Script (async in background)" and a trigger of your choosing.
tellapplication "Finder" toactivate
tellapplication "Finder"
display dialog "Are you sure you want to shut down your