No internet connection
  1. Home
  2. Packages
  3. Pro Tools Utilities

Open Send on Next Available Slot issue

By Gary Philips @Gary_Philips
    2022-01-10 07:34:38.302Z

    I've been working with both the original code and with my customized send assignments, but in all cases I'm getting an error at line 70. Am I missing something here? TY:

    
    const { sendPath } = event.props;
    if (!sendPath) throw `Send Path is required`;
    
    /**
    * @param {object} args
    * @param {(arg0: { getValue: (name: string) => boolean; setValue: (name: string, value: boolean) => void; }) => void} args.callback
    * @param {boolean} args.doRestore
    */
    function withEditViewConfig({ callback, doRestore }) {
        let config = sf.ui.proTools.getMenuItem('View', 'Edit Window Views').children.first.children.filter(c => c.title.value !== 'All' && c.title.value !== 'Minimal').
            map(c => ({
                title: c.title.value,
                isChecked: c.isMenuChecked,
                original: c.isMenuChecked,
                element: c,
            }));
    
        let funcs = {
            getValue: (/** @type {string} */ name) => {
                let item = config.find(c => c.title === name);
                return item ? item.isChecked : undefined;
            },
            setValue: (/** @type {string} */ name, /** @type {boolean} */ value) => {
                let item = config.find(c => c.title === name);
                if (!item) throw `Couldn't find item "${name}"`;
                if (value !== item.element.isMenuChecked) {
                    item.element.elementClick();
                }
                item.isChecked = item.element.invalidate().isMenuChecked;
            }
        };
    
        try {
            callback(funcs);
        } finally {
            if (doRestore) {
                for (let item of config) {
                    if (item.isChecked !== item.original) {
                        item.element.elementClick();
                    }
                }
            }
        }
    }
    
    /**
    * @param {(slotIndex: number) => void} callback
    */
    function withNextAvailableSendSlotIndex(callback) {
        withEditViewConfig({
            callback: (view) => {
                for (let i = 0; i < 10; i++) {
                    let btn = sf.ui.proTools.selectedTrack.sendButtons[i];
                    if (!btn.exists) {
                        view.setValue(i < 5 ? 'Sends A-E' : 'Sends F-J', true);
                        btn.invalidate();
                    }
                    if (btn.exists && btn.value.invalidate().value === 'unassigned') {
                        callback(i);
                        break;
                    }
                }
            },
            doRestore: false,
        });
    }
    
    withNextAvailableSendSlotIndex(slotIndex => {
        sf.ui.proTools.selectedTrack.sendButtons[slotIndex].popupMenuSelect({
            menuPath: sendPath,
        });
    });
    
    
    • 33 replies

    There are 33 replies. Estimated reading time: 19 minutes

    1. What's the error you're getting?

      1. Gary Philips @Gary_Philips
          2022-01-10 09:48:36.737Z

          I will check the exact text tomorrow, but something about a pop up window at line 70. thanks!

          1. The code above is a template that requires a "sendPath" variable to be configured as a string array in which you for each preset type in the corresponding "path" to the send you want to add.
            You can see how that's done in the original template from the package.

            Is there a specific reason you're not using the template directly from the package? Or, in case you are, can share a screenshot of the presets you're using?

            1. Gary Philips @Gary_Philips
                2022-01-10 21:41:43.871Z

                Hi Christian, thanks for the reply. I am using the template, I just wasn't sure how to share that on the forum without copying the code -- still new here!
                The only variable I changed was the second one where i replaced your "bus 1-2" with my own aux paths. screen shot here:

                And here is the recent info from the log right after I got the error:

                10.01.2022 13:39:24.15 [Backend]: Logging error in action (01) WaitForPopupMenuAction: Popup window was not found after waiting 2000 ms
                Logging error in action (01) OpenPopupMenuFromElementAction: Popup menu was not found
                Logging error in action (01) PopupMenuSelectAction: Could not open popup menu

                10.01.2022 13:39:24.15 [Backend]: Logging unknown error in action (02) RunCommandAction: Open Send on Next Available Slot: Line 70

                10.01.2022 13:39:24.15 [Backend]: !! Command Error: Send H3000 [user:cky8bukko0006s410ibh8xmtx:cko2k3o9r0001zu10nq6d5efx#cky8ccerq0007s41095szuag5]:
                Could not open popup menu (Open Send on Next Available Slot: Line 70)
                Popup menu was not found
                Popup window was not found after waiting 2000 ms

                << Command: Send H3000 [user:cky8bukko0006s410ibh8xmtx:cko2k3o9r0001zu10nq6d5efx#cky8ccerq0007s41095szuag5]

                10.01.2022 13:39:40.81 [Backend]: [SF_FIREBASE_WS]: Sending keep-alive

                1. Hey Gary!

                  The problem is that the Send Path has to be exactly how it is on the Pro Tools menus. If it varies just a bit, the script won't be able to find it since it's looking for an exact match. In this case, you're missing either '(Mono)' or '(Stereo)' at the end of 'H3000'.

                  See the screenshot below to see what I mean:

                  1. Gary Philips @Gary_Philips
                      2022-01-10 23:07:30.146Z

                      Oh I see -- I had assumed the software resolved that itself. Still learning here. . . ok, so I'll go back and reprogram those commands to include mono/stereo in the path and try again. Thanks Raphael!

                      1. Gary Philips @Gary_Philips
                          2022-01-11 06:19:48.470Z

                          Hmmmmmmmm. So I did go back and include "(Stereo)" in the path but I'm getting the same Error at line 70. Here's the log, and I'll post a screen shot of the preset below that. What else could it be here? Thank you!

                          0.01.2022 22:16:17.69 <info> [Backend]: Validating command... user:default:cky8d4ocq000fs41018sx4qxs#cky8ccerq0007s41095szuag5
                          Invoking command...user:default:cky8d4ocq000fs41018sx4qxs#cky8ccerq0007s41095szuag5
                          
                          10.01.2022 22:16:17.69 <info> [Backend]: >> Command: Send H3000 [user:default:cky8d4ocq000fs41018sx4qxs#cky8ccerq0007s41095szuag5]
                          
                          10.01.2022 22:16:17.79 <info> [Backend]: Clicking with mouse here: 397, 767
                          
                          10.01.2022 22:16:20.03 <info> [Backend]: Logging error in action (01) WaitForPopupMenuAction: Popup window was not found after waiting 2000 ms
                          Logging error in action (01) OpenPopupMenuFromElementAction: Popup menu was not found
                          Logging error in action (01) PopupMenuSelectAction: Could not open popup menu
                          
                          10.01.2022 22:16:20.03 <info> [Backend]: Logging unknown error in action (02) RunCommandAction: Open Send on Next Available Slot: Line 70
                          !! Command Error: Send H3000 [user:default:cky8d4ocq000fs41018sx4qxs#cky8ccerq0007s41095szuag5]:
                          Could not open popup menu (Open Send on Next Available Slot: Line 70)
                              Popup menu was not found
                              Popup window was not found after waiting 2000 ms
                          
                          
                          10.01.2022 22:16:20.03 <info> [Backend]: << Command: Send H3000 [user:default:cky8d4ocq000fs41018sx4qxs#cky8ccerq0007s41095szuag5]
                          
                          10.01.2022 22:16:35.90 <info> [Backend]: [SF_FIREBASE_WS]: Sending keep-alive
                          
                          
                          1. That's weird. Your log says that trying to open the send menu was unsuccessful. Could you do a screen recording of the script failing so I can see? The culprit may be more apparent there.

                            1. Gary Philips @Gary_Philips
                                2022-01-12 03:34:40.786Z
                                1. Ok, so it's definitely able to open the send menu. That's a good thing!

                                  The error in the video was that it couldn't find the menu item. We have to make sure that the path is exactly how it is on Pro Tools.

                                  I know you already made adjustments, but is there any chance the session you're on has more than 128 buses? Reason being the menus change when that's the case, like so:

                                  1. Gary Philips @Gary_Philips
                                      2022-01-12 04:33:06.322Z

                                      To be sure I just made a test session with only the fx return busses, so about 25 stereo busses in the session. Still got the same error. And it also happens regardless of whether I'm sending to a mono or stereo bus.

                                      And here's the bus tab on my I/O. . .

                                      1. Damn... yeah, everything looks correct.

                                        The only difference I can see between your setup and mine is that you seem to be running Big Sur or Monterey and I'm still on Catalina. Maybe there's something different about the way the menus are displayed.

                                        Let's try this. Select a track that has the first send available and run this code:

                                        log(sf.ui.proTools.selectedTrack.sendButtons[0].popupMenuFetchAllItems().menuItems.filter(mi => mi.path[1] && mi.path[1].includes('H3000 (Stereo)')));
                                        

                                        This will attempt to fetch the 'H3000 (Stereo)' menu item and log it.

                                        If there are no errors, could you go to the log and copy something that will look like this and paste it here?

                                        11.01.2022 23:02:57.94 <info> [Backend]: [LOG] [
                                            {
                                                "Path": [
                                                    "bus",
                                                    "H3000 (Stereo)"
                                                ],
                                                "Names": [
                                                    "bus",
                                                    "H3000 (Stereo)"
                                                ],
                                                "Delimiter": " -> ",
                                                "Element": "{\"title\":\"H3000 (Stereo)\",\"role\":\"AXMenuItem\",\"fullRole\":\"AXMenuItem\"}",
                                                "path": [
                                                    "bus",
                                                    "H3000 (Stereo)"
                                                ]
                                            }
                                        ]
                                        
                                        1. Gary Philips @Gary_Philips
                                            2022-01-12 05:23:55.238Z

                                            Thanks Raphael. Will try this when I'm back at a machine. FYI, running Catalina here as well, no Big Sur or Monterey. Hmmmm.

                                            1. Interesting. I only assumed that because your menus look different than mine—as you can see from our screenshot exchange lol.

                                              Ok yeah, try that when you get a chance and hopefully, we'll gain some more insight!

                                              1. Gary Philips @Gary_Philips
                                                  2022-01-12 05:41:16.816Z

                                                  Ha. yeah, I had some issue with Dark mode when I switched the MacOS preference to auto for a moment. When I switched it back, all my protools menus looked different. Not worth chasing down!
                                                  Regarding that code you just sent, I'm not sure why i can't copy text from the log window, but here is a screenshot of the log in when I ran that code:

                                                  1. Ah, gotcha!

                                                    For the code I sent, I was hoping you would run it while on that session you were testing on before. Make sure to have a track selected, the sends i/o is showing and the first send is available.

                                                    What it will do is open the menu from the first send of the selected track and try to get the H3000 path from there.

                                                    Just to make sure, add this to the top of that script: sf.ui.proTools.appActivateMainWindow();

                                                    Oh, and to open the full log so you can copy from, that's available from the SoundFlow menu icon, second page, "Open Log File":

                                                    1. Gary Philips @Gary_Philips
                                                        2022-01-12 06:00:47.830Z

                                                        Got it. Will do. Btw, I leave the sends menu visible in the mix window, but not in the edit window in most sessions. If that would have any effect….

                                                        1. Gotcha. That won't matter for the main script we're trying to get going, but for this test, since it's very simple, make sure to run it on the edit window with the sends visible.

                                                          1. Gary Philips @Gary_Philips
                                                              2022-01-12 06:13:26.300Z

                                                              hows this?

                                                              << Command: Raphael_LogH3000 [user:default:ckyb3seqk00027510exic6e3i]
                                                              
                                                              11.01.2022 22:12:15.91 <info> [Backend]: Validating command... user:default:ckyb3seqk00027510exic6e3i
                                                              Invoking command...user:default:ckyb3seqk00027510exic6e3i
                                                              
                                                              11.01.2022 22:12:15.91 <info> [Backend]: >> Command: Raphael_LogH3000 [user:default:ckyb3seqk00027510exic6e3i]
                                                              
                                                              11.01.2022 22:12:16.00 <info> [Backend]: Clicking with mouse here: 1990, 29
                                                              
                                                              11.01.2022 22:12:16.16 <info> [Backend]: Clicking with mouse here: 407, 597
                                                              
                                                              11.01.2022 22:12:18.44 <info> [Backend]: Logging error in action (01) WaitForPopupMenuAction: Popup window was not found after waiting 2000 ms
                                                              Logging error in action (01) OpenPopupMenuFromElementAction: Popup menu was not found
                                                              Logging error in action (01) PopupMenuFetchAllItemsAction: Could not open popup menu from specified element
                                                              
                                                              11.01.2022 22:12:18.44 <info> [Backend]: !! Command Error: Raphael_LogH3000 [user:default:ckyb3seqk00027510exic6e3i]:
                                                              Could not open popup menu from specified element (Raphael_LogH3000: Line 2)
                                                                  Popup menu was not found
                                                                  Popup window was not found after waiting 2000 ms
                                                              
                                                              << Command: Raphael_LogH3000 [user:default:ckyb3seqk00027510exic6e3i]
                                                              
                                                              1. Ah what a bummer, it ended up failing again.

                                                                Ok, as a last resort, could you restart your computer and then try running the "Open Send on Next Available Slot' script? This is definitely not normal behavior so I'm hoping that a restart will flush any gremlins.

                                                                1. Gary Philips @Gary_Philips
                                                                    2022-01-12 23:56:38.431Z

                                                                    Aargh. Restarted the machine and just tried the script in several different sessions with the same Line 70 error every time. I even tried your factory preset with bus 1-2 and that threw the same error although there's a "default" bus 1-2 in the session too. . . . Wow this stuff can be frustrating as well as time-saving, eh? thanks for the help trying to suss this out, Raphael.

                                                                    1. Ok, yeah we're facing some sort of new bug here. I think we're gonna have to take a deeper dive. Thanks for all your patience with this.

                                                                      @Kitch Should we track this as a bug?

                                                                      In summary, Gary's setup is having trouble handling popupMenus using popupMenuSelect() or popupMenuFetchAllItems(). Seems to be specific to the Sends I/O buttons since he has been able to run the script over at this other thread successfully, which utilices sf.ui.proTools.selectedTrack.outputPathButton.popupMenuSelect() .

                                                                      In this thread, we've seen his system not being able to consistently open the desired popupMenu, and when it is able to, it can't find the desired popupMenuItem. We've gone through all the usual suspects and everything checks out. I've replicated his setup and was not able to reproduce the bug.

                                                                      1. Kitch Membery @Kitch2022-01-13 07:14:42.923Z

                                                                        Hi @raphaelsepulveda

                                                                        Yeah, that seems strange. Thanks for the rundown on the situation.

                                                                        @Gary_Philips, thanks for your patience. Would you be able to fill out a bug report for this issue?

                                                                        Please click here to send us the information we need.

                                                                        Hopefully, we'll be able to sort the issue out. :-)

                                                                        1. Gary Philips @Gary_Philips
                                                                            2022-01-13 18:34:44.070Z

                                                                            Will do. I'm still pretty green around here so please check my work on the bug report!

                                                                            1. Kitch Membery @Kitch2022-01-13 18:36:09.053Z

                                                                              Much appreciated @Gary_Philips.

                                                                              1. Gary Philips @Gary_Philips
                                                                                  2022-01-13 20:22:06.662Z

                                                                                  I submitted that bug report, but there's that weirdness where soundflow is always getting caught up logging me in/out of my account at random times. So the report hung while it SEEMS like soundflow was trying and failing to log me in, again. Question being, where could I check to see my submitted bug reports to check if it went through?

                                                                                  1. Kitch Membery @Kitch2022-01-13 20:29:45.071Z

                                                                                    Hi @Gary_Philips,

                                                                                    If you've logged a bug report it should show up in the Support Section of the forum.

                                                                                    I'm not sure I understand what you mean by "that weirdness where SoundFlow is always getting caught up logging me in/out of my account at random times". Have you logged a bug report for this? That is not expected behavior.

                                                                                    Thanks in advance.

                                                                                    1. In reply toGary_Philips:
                                                                                      Gary Philips @Gary_Philips
                                                                                        2022-01-13 20:30:55.834Z

                                                                                        Hmm, yeah, just tried to submit it again and got this error again:

                                                                                        If I go to manage my sessions, it says I have no active sessions. . . which of course I do b/c I'm posting here rn

                                                                                        1. Kitch Membery @Kitch2022-01-13 20:33:19.035Z

                                                                                          That is very strange.

                                                                                          Can I get you to Quit SoundFlow from the SoundFlow Icon and then relaunch it from the Applications folder?

                                                                                          After that let me know if the error persists.

                                                                                          1. Gary Philips @Gary_Philips
                                                                                              2022-01-13 20:37:15.354Z

                                                                                              will do.

                                                                                            • In reply toGary_Philips:
                                                                                              Gary Philips @Gary_Philips
                                                                                                2022-01-13 20:36:27.937Z

                                                                                                And yes, I do seem to get issues where Soundflow is unable to log me in automatically and I have to manually put in my credentials. And seems to get caught in situations where it needs to be restarted b/c of an inability to log in. . . . I'd be happy to log a bug report but I'm not sure how to replicate or even what to say other than it seems to get funky. Also, I don't seem to be able to submit bug reports. :-)

                                                                                                1. Gary Philips @Gary_Philips
                                                                                                    2022-01-13 20:40:44.519Z

                                                                                                    OK, that quit and restart from applications folder worked and allowed me to submit the bug report for this thread. Thanks!

                                                                                                    1. Kitch Membery @Kitch2022-01-13 20:43:23.991Z

                                                                                                      Wonderful. Thanks again. Next time you see the connection issue be sure to submit a bug report for that too. From the log files that get attached when you submit the report, we'll hopefully be able to see what's happening :-)