No internet connection
  1. Home
  2. How to

Menu Bar Item Help

By Edward Sokolowski @Edward_Sokolowski
    2024-05-08 19:40:24.093Z

    Hi there, apologies for the basic nature of this question. Hopefully that just means its very quick to answer.

    I'm trying to make a macro for selecting Loud/Normal/Quiet/Soft (and later the input sources would be handy) from the ListenHub menu bar. I am able to click the first item "Open ListenHub", but the ones below have the greyed out headers, and I'm not sure how to select these.

    To open ListenHub, I have this:

    sf.ui.app('com.sonnox.listenhub').getElement('AXExtrasMenuBar').popupMenuSelect({ menuPath: ['Open ListenHub'] });
    

    and the full list looks like this:

    Any help would be appreciated!

    Thanks

    • 2 replies
    1. E
      Edward Sokolowski @Edward_Sokolowski
        2024-05-08 20:31:07.848Z

        I found another post where someone had kindly written all the paths out. Turns out there was a number of spaces that needed to be included in the path name.

        Here is the post: Selecting 2nd item of identical name in popup menu #post-10

        1. Kitch Membery @Kitch2024-05-08 22:06:00.771Z

          Hi @Edward_Sokolowski

          Extra menu bars that reside up by the system clock can be tricky to work with, however give this script a go and see if it does what you need.

          const app = sf.ui.app('com.sonnox.listenhub');
          const extraMenuBar = app.getElement('AXExtrasMenuBar');
          const extraMenuBarItem = extraMenuBar.children.first;
          
          extraMenuBarItem.popupMenuSelect({
              menuPath: ["Open ListenHub"],
          });
          

          This script is untested as I don't have Listen Hub on my system. So it's purely a guess.

          Let me know how it goes for you.