No internet connection
  1. Home
  2. Support

Problem with popup menu on new session dialog window

By Nacho @Nacho_Sotelo
    2020-12-21 17:47:20.302Z

    When creating a new session (File > Create New) I can't get this to work:

    sf.ui.proTools.windows.whoseTitle.is('Dashboard').first.popupButtons.allItems[2].popupMenuSelect({
        menuPath: ["44.1 kHz"],
    }); 
    

    I keep getting:
    Error invoking popupMenu.select (ScriptName: Line 1)
    Could not click popup menu item
    Could not find menu item with name: 48 kHz

    Same with the other popup menu items on that window (File Type, etc...)

    Any ideas? I can see the popup menu being clicked on by soundflow and then showing that error.

    • 10 replies
    1. This issue happens to me too with some popup menus whenever you launch Pro Tools for the first time and the menus still look normal (not light gray). Once I run a script that typically works and the menus turn gray, then I re-gain access to selecting popup menus, such as like on your script above. Is this the same case for you?

      If so, maybe @chrscheuer can let us know of a work-around to activate popupmenu automation when you first start PT. sf.ui.proTools.axModeInitialize(); looked promising, but no cigar.

      1. NNacho @Nacho_Sotelo
          2020-12-21 19:27:57.790Z

          You're right, once I run another script and the menus change color I can get the script to work

          1. The issue here is that we need to tell Pro Tools to switch to what we call "accessibility mode". This is the mode that allows us to work with the popup menus. We haven't implemented a way to switch into the accessibility mode for modal dialogs, right now we rely on doing this in the Edit window.
            This explains why you're seeing the issue in the Dashboard on first launch.

            1. Ahh, that makes sense.

              @Nacho_Sotelo , I tinkered around with this for a bit and was able to find a workaround.

              Turns out that using elementClick() on any element in that window triggers the accessibility mode, so I wrote this script to first try and change the sample rate, if it fails, it'll use elementClick() on that popupButton to trigger accessibility mode, and then it'll try to change the sample rate again.

              It's a bit hacky but gets the job done!

              const sampleRate = '44.1 kHz';
              const sampleRatePopupBtn = sf.ui.proTools.windows.whoseTitle.is('Dashboard').first.popupButtons.allItems[2];
              
              /** @param { AxElement } popupButton */
              function makeSureAccessibilityModeIsOn(popupButton) {
                  // Trigger Accessibility Mode with elementClick
                  popupButton.elementClick({ asyncSwallow: true });
                  sf.keyboard.press({ keys: "escape" });
              };
              
              try {
                  // Try to change sample rate
                  sampleRatePopupBtn.popupMenuSelect({
                      menuPath: [sampleRate],
                  });
              } catch (err) {
                  // If error, trigger accessibility mode and try again
                  makeSureAccessibilityModeIsOn(sampleRatePopupBtn);
              
                  sampleRatePopupBtn.popupMenuSelect({
                      menuPath: [sampleRate],
                  });
              };
              

              Cool thing is that this can be used on any popup menu that could fail in a similar way. I know I've had this happen with the ones on the New Tracks window.

              1. In reply tochrscheuer:
                JJuan B Caballero @Juan_B_Caballero
                  2022-03-31 21:37:54.020Z

                  I had the same issue in 3 different Macs (Mac Pro 2014, Macbook i7 2020 and MacBook i9 2019. All of them where configured from the scratch and loaded with original software. Today, I received the advice to get a ride of Google Chrome (I had it on all Macs) in order to improve the performance of mi i9. Once I tried Protools after uninstalling Chrome, I realiced thar the issue was SOLVED!!
                  I checked with some SoundFlow users friends who never had the issue and none of them had installed Chrome in their Comps.

                  To uninstall Chrome in a complete way, copy and execute one by one all this commands in a terminal.
                  Chrome full uninstall

                  rm -rf /Applications/Google\ Chrome.app/
                  rm /Library/LaunchAgents/com.google.keystone*
                  rm -rf /Library/Application\ Support/Google/Chrome
                  rm ~/Library/Preferences/com.google.Chrome*
                  rm -rf ~/Applications/Chrome\ Apps.localized/
                  rm ~/Library/LaunchAgents/com.google.keystone*
                  rm -rf ~/Library/Application\ Support/Google/Chrome
                  rm ~/Library/Preferences/com.google.Chrome*
                  rm -rf ~/Library/Application\ Support/CrashReporter/Google\ Chrome
                  rm ~/Library/Preferences/Google\ Chrome*
                  rm -r ~/Library/Caches/com.google.Chrome*
                  rm -r ~/Library/Saved\ Application\ State/com.google.Chrome.savedState/
                  rm ~/Library/Google/GoogleSoftwareUpdate/Actives/com.google.Chrome
                  rm ~/Library/Google/Google\ Chrome*

                  Best regards!

                  1. Hi Juan,

                    I'm happy to hear that you got an issue solved. That being said, there's nothing that indicates SoundFlow and Chrome doesn't work well together. We don't recommend uninstalling Chrome if you have it. In fact, many of our users use those two apps together (and SoundFlow is developed on a computer with Chrome installed).

                    Moreover, the particular issue in this thread has absolutely nothing to do with Chrome. It has to do with accessibility mode in Pro Tools. See this thread for a full discussion and video:

                    Again, I have to strongly disagree with what you posted about Chrome, even if I'm sure you were just trying to help :)

                    1. JJuan B Caballero @Juan_B_Caballero
                        2022-04-01 05:51:19.967Z

                        You're absolutely right. I was trying to help and uninstalling chrome doesn't solve the problem. On my i7 I ran a "solo selected track" command and after that the menus were still black. But when double checking with a "chnge grid" command, the error came up.
                        Tomorrow I will do some additional checks in my studio with my i9. I was pretty sure the issue was resolved, but now I'm starting to doubt it.
                        Even though, as said, uninstalling chrome doesn't fix this problem, I was still able to experience that protools and the macbook in general work better without chrome. a technician was the one who recommended me to get rid of chrome to improve the performance of the macbook

                        1. Got it, thanks. But in terms of the menus, please watch our video and article above. This is a known issue that you won't be able to fix. There's a full explanation in the link I sent.

                          1. JJuan B Caballero @Juan_B_Caballero
                              2022-04-01 13:19:11.475Z

                              I've watched the video. I understand... I'm sad to hear there is no solution for that. Maybe in the future. I have 3 different Macs with the same issue. I've heard some people doesn't have problems at all. What could it be the reason? A particular combination of OS and model?.
                              Moving on to another topic, do you have any idea on how Google Chrome affects the Mac and Protools CPU usage and performance? Several engineers and Mac technicians gave some advice about that.
                              Thanks again. Sorry for rushing and giving a false solution without checking it properly.
                              Regards

                              1. Hi Juan, I haven't experienced any issues with Chrome, so I can't give any comment to that unfortunately.