How to activate a menu item of an element of the bar menu

As I posted in that thread:

Since I posted this topic nearly 3 years ago, I've learned a lot.
So, I no longer recommend this tool, as it does not work with all macOS's.
Instead, I suggest you try one of these tools:

  1. UIElementInspector provided as part of the free Xcode download (as @Tom suggests)
  2. Use the AppleScript tool by Chris @ccstone
    Front Window Analysis Tool for System Events
  3. For more complex UI scripting, you will benefit from UIBrowser , which works will all macOS including Mojave.

Probably UIBrowser would be the best tool for this job.