I use my PowerBook as a poor man's DVD player and HDTV combination. To that end, I use the wonderful Keyspan DMR to control the DVD Player software from the couch. The only downfall of the DMR is the included remote's lack of an eject button.
I have, however, reprogrammed the remote's 'Toggle Application' button -- which is completely useless while watching DVDs -- to run an AppleScript I have written. This AppleScript will quit DVD Player and eject the DVD. I thought that other people using the DMR might want a way to eject DVDs, and so, would like to share the script. Here it is:
tell application "DVD Player"
quit
end tell
tell application "Finder"
set the_items to (items of the desktop whose kind is "volume")
repeat with i from 1 to count of the_items
if folder "VIDEO_TS" of item i of the_items exists then
eject item i of the_items
end if
end repeat
end tell
I should think that the documentation included with the DMR should indicate how to program a button to run an AppleScript.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20050227213630995