scripting the... hardware

Do you know a way to open/close the CD tray on the newest G4? Via hardware the only way is pressing the key on the keyboard…