You can eject a volume using AppleScript as described here:
For more information, see the wiki Searching the Forum for Answers section.