The WinMenuSelectItem of autohotkey’s speed is almost as fast as PostMessage.
The format is:
WinMenuSelectItem, window’s title,, File, item
WinMenuSelectItem, window’s title,, 1&, 2&
The 2nd format using a number plus “&”:
The name of the top-level menu, e.g. File, Edit, View. It can also be the position of the desired menu item by using 1& to represent the first menu, 2& the second, and so on.