Take a look at Use AppleScript to get oldest record in a given group. The name is misleading, the script can also get the newest record.
I would actually do it the other way round, there’s nothing more reliable to open a menu than Keyboard Maestro’s Select menu action.