No internet connection
  1. Home
  2. How to

Setting up multiple sends and choosing outputs

By Kristoffer Lo @Kristoffer_Lo
    2022-12-14 12:51:59.699Z

    Hi,
    I'm running Pro Tools and would like to route some sends for monitor purposes.
    Is there a macro/script that can do this:

    1. Add a send to a selected track
    2. Name the send
    3. Select specific output for the send

    So, if I have a vox track, I would like to create a send, name the send "Monitor 1", choose output "CUE 1-2".
    Moving on from this, I would like to the same on the next sends channel, but naming it "Monitor 2" and choose output "CUE 3-4".

    Is there anybody out there that can help me with this?

    Solved in post #4, click to view
    • 19 replies

    There are 19 replies. Estimated reading time: 14 minutes

    1. samuel henriques @samuel_henriques
        2022-12-15 12:29:17.737Z

        Hello Kristoffer,

        Which send slot would you like to use? Starting on 1 or first available, or you have designated slots for this?

        1. K
          In reply toKristoffer_Lo:
          Kristoffer Lo @Kristoffer_Lo
            2022-12-15 12:33:23.378Z

            Hi Samuel, thanks for your response.

            Just the first available.

            Thanks!

            1. samuel henriques @samuel_henriques
                2022-12-15 14:22:14.169Z2024-02-23 18:26:04.325Z

                This will find the first visible and free send on the first selected track.
                Then will find if the monitor name ("Monitor 1", "Monitor 2"...) exists.
                If it exists will create a send to that Aux on ALL selected tracks. If not, it'll create a new aux, for the new send, with the name as you asked and will set the new aux output to the out you define.

                Set the output as you see it in pro tools. Notice the S in Stereo is in capital, but b in bus is not? Thats important.

                Let me know how it goes:

                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //////////////////////////////////////////////////////Set Monitor List//////////////////////////////////////////////////////
                
                const monitorSendList = [
                    { monitorName: "Monitor 1", outputPath: ["output", "A CUE1 L/R (Stereo) -> A CUE1 L/R"] },
                    { monitorName: "Monitor 2", outputPath: ["output", "A CUE2 L/R (Stereo) -> A CUE2 L/R"] },
                    { monitorName: "Monitor 3", outputPath: ["output", "A CUE3 L/R (Stereo) -> A CUE3 L/R"] },
                    { monitorName: "Monitor 4", outputPath: ["output", "A CUE4 L/R (Stereo) -> A CUE4 L/R"] },
                ];
                
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                function getFirstFreeSend() {
                    return sf.ui.proTools.selectedTrackHeaders.map(th => th.invalidate().sendSelectorButtons.find(send => send.exists && send.value.invalidate().value === "unassigned"))[0]
                };
                
                function setNewAuxOutputPath(trackName, path) {
                
                    const track = sf.ui.proTools.trackGetByName({ name: trackName }).track
                    track.trackSelect();
                    track.trackScrollToView();
                    track.trackOutputSelect({ outputPath: path });
                
                };
                
                
                
                function setNewAux(trackName) {
                
                    const newTrackWin = sf.ui.proTools.windows.whoseTitle.is("New Track").first
                    newTrackWin.elementWaitFor({}, "New Track Win didn\' open.");
                    // Track Format
                    const trackFormat = newTrackWin.popupButtons.whoseDescription.is("Track format").first
                    trackFormat.value.invalidate().value !== "Stereo" ? trackFormat.popupMenuSelect({ menuPath: ["Stereo"] }) : null
                    // Track Type
                    const trackType = newTrackWin.popupButtons.whoseDescription.is("Track type").first
                    trackType.value.invalidate().value !== "Aux Input" ? trackType.popupMenuSelect({ menuPath: ["Aux Input"] }) : null
                    // Track Time Base
                    const timeBase = newTrackWin.popupButtons.whoseDescription.is("Track time base").first
                    timeBase.value.invalidate().value !== "Samples" ? timeBase.popupMenuSelect({ menuPath: ["Samples"] }) : null
                    // Track Name
                    newTrackWin.textFields.whoseTitle.is("Track name").first.elementSetTextFieldWithAreaValue({ value: trackName });
                
                    // Disable "Create nest to current track". In case of multiple tracks, it'll create after the last selected
                    newTrackWin.checkBoxes.first.checkboxSet({ targetValue: "Disable", });
                
                    newTrackWin.buttons.whoseTitle.is("Create").first.elementClick();
                
                    newTrackWin.elementWaitFor({ waitType: "Disappear" }, "New Track Win didn\' close.");
                };
                
                
                function getUserChooseMonitor(items) {
                
                    let interaction = sf.interaction.popupSearch({
                        title: "Choose monitor to create.",
                        items: items.map((el, i) => ({ name: i + 1, monitorName: el.monitorName, outputPath: el.outputPath.join(" ==> ") })),
                        columns: [
                            { name: '', key: 'name', width: 5 },
                            { name: 'Monitor Name', key: "monitorName", width: 30 },
                            { name: 'Output Path', key: "outputPath", width: 70 }
                        ],
                    }).item;
                
                    return {
                        monitorName: interaction.monitorName,
                        outputPath: interaction.outputPath.split(" ==> "),
                    };
                };
                
                
                function main() {
                
                    sf.ui.proTools.appActivateMainWindow();
                    sf.ui.proTools.invalidate();
                
                    const firstSend = getFirstFreeSend()
                    if (!firstSend) { alert("There are no visible sends."); throw 0 }
                
                    const { monitorName, outputPath } = getUserChooseMonitor(monitorSendList)
                
                
                    // Get next free send, create new track is send doesn't exit or just add send
                    getFirstFreeSend().popupMenuSelect({
                        isShift: true,
                        isOption: true,
                        menuSelector: menuItems => {
                            let monitorPathExists = menuItems.find(item => item.path[0] === "track" && item.path[1].includes(monitorName))
                            if (monitorPathExists) {
                                return monitorPathExists
                            } else {
                                return menuItems.find(item => item.path[0] === "new track...");
                            };
                        }
                    });
                
                    // If new track is creates, we need to invalidate again
                    sf.ui.proTools.invalidate();
                
                
                    // If new track, set options
                    const newTrackWin = sf.ui.proTools.windows.whoseTitle.is("New Track").first
                    newTrackWin.elementWaitFor({ onError: "Continue" })
                    if (newTrackWin.exists) {
                        setNewAux(monitorName);
                        setNewAuxOutputPath(monitorName, outputPath);
                    };
                };
                
                main();
                
                
                ReplySolution
                1. KKristoffer Lo @Kristoffer_Lo
                    2022-12-15 14:34:55.005Z

                    Hi @samuel_henriques, this worked like a charm! Thank!
                    I just renamed the monitor output path to fit my setup.

                    Is it possible to try to create a pop-up, you think?
                    Ideally I would like to have this setup every time:
                    "Monitor 1" sent to "A CUE1 L/R (Stereo) -> A CUE1 L/R"
                    "Monitor 2" sent to "A CUE2 L/R (Stereo) -> A CUE2 L/R"
                    "Monitor 3" sent to "A CUE3 L/R (Stereo) -> A CUE3 L/R"
                    "Monitor 4" sent to "A CUE4 L/R (Stereo) -> A CUE4 L/R"

                    My output path is
                    ["output", "A CUE1 L/R (Stereo) -> A CUE1 L/R"]

                    Thank you so much for this, this is really awesome!!

                    Kristoffer

                    1. samuel henriques @samuel_henriques
                        2022-12-15 16:36:50.631Z2022-12-16 08:41:50.879Z

                        Updated above, just change these to your paths, and add as many as you need.

                        const monitorSendList = [
                            { monitorName: "Monitor 1", outputPath: ["output", "A CUE1 L/R (Stereo) -> A CUE1 L/R"] },
                            { monitorName: "Monitor 2", outputPath: ["output", "A CUE2 L/R (Stereo) -> A CUE2 L/R"] },
                            { monitorName: "Monitor 3", outputPath: ["output", "A CUE3 L/R (Stereo) -> A CUE3 L/R"] },
                            { monitorName: "Monitor 4", outputPath: ["output", "A CUE4 L/R (Stereo) -> A CUE4 L/R"] },
                        ];
                        
                        1. samuel henriques @samuel_henriques
                            2022-12-15 16:44:02.010Z

                            New Update, minor fixes.

                            1. KKristoffer Lo @Kristoffer_Lo
                                2022-12-16 07:50:22.674Z

                                Hi @samuel_henriques, and again, thank you so much for this.

                                I do get a error on this, I think it has to do with the output path (my output path is actually this whole thing "A CUE2 L/R (Stereo) -> A CUE2 L/R", so the arrow is a part of the output patch).
                                Do you want me to send the error messages from Soundflow?
                                The short error message is:
                                "Could not select output menu item"
                                I've attached my outputs, so you can see.

                                1. samuel henriques @samuel_henriques
                                    2022-12-16 08:43:51.286Z

                                    Sorry, I misunderstood, just updated with a fix.

                                    1. Ooleg baranov @oleg_baranov6
                                        2024-02-22 10:30:12.135Z

                                        Hello @samuel_henriques ! It doesn't work for me for some reason. If monitor name "Monitor 1"exists the script make "Monitor 1.1" and so on. There is PT Ultimate 2023.12.1

                                        1. samuel henriques @samuel_henriques
                                            2024-02-22 17:58:04.858Z

                                            Hello Oleg,
                                            I get the same if I choose "Monitor 1" again from the popup, If i choose one that doesn't exist yet I get the new name.
                                            Maybe you need this to behave differently that it's currently scripted.
                                            You can explain a bit how you would like this to behave or send a screen capture showing where its failing.

                                            1. Ooleg baranov @oleg_baranov6
                                                2024-02-23 18:06:36.369Z

                                                thank You @samuel_henriques !
                                                You wrote before about this script: "...Then will find if the monitor name ("Monitor 1", "Monitor 2"...) exists.If it exists will create a send to that Aux on ALL selected tracks. If not..."
                                                It's exactly what I need.

                                                1. samuel henriques @samuel_henriques
                                                    2024-02-23 18:27:59.196Z

                                                    indeed, my apologies. It wasn't working.
                                                    Just updated, try now please.

                                                    1. Ooleg baranov @oleg_baranov6
                                                        2024-02-24 17:26:51.209Z

                                                        @samuel_henriques thanks a lot! The script works p e r f e c t l y.
                                                        Life couldn't be better.

                                  • K
                                    In reply toKristoffer_Lo:
                                    Kristoffer Lo @Kristoffer_Lo
                                      2022-12-16 11:22:21.060Z

                                      Thanks again, @samuel_henriques !

                                      It dosen't quite work yet. I'm getting these errors:

                                      "Could not open popup menu (Lytting: Line 84)
                                      Popup menu was not found"
                                      "Could not select output menu item: 'output: A CUE2 L/R (Stereo): A CUE2 L/R' (Lytting: Line 22)
                                      Could not click popup menu item"
                                      "Could not select output menu item: 'A CUE3 L/R (Stereo): A CUE3 L/R' (Lytting: Line 22)
                                      Could not click popup menu item"
                                      "Object reference not set to an instance of an object. (Lytting: Line 19)"

                                      1. samuel henriques @samuel_henriques
                                          2022-12-16 11:30:41.345Z

                                          Just noticed where it could be wrong, my bad. give me a bit and I'll fix it

                                          1. In reply toKristoffer_Lo:
                                            samuel henriques @samuel_henriques
                                              2022-12-16 12:24:03.750Z

                                              UPDATED, with a fix.

                                              1. KKristoffer Lo @Kristoffer_Lo
                                                  2022-12-16 12:36:36.834Z

                                                  Thank you so much, @samuel_henriques - this works like an absolute charm!

                                              2. K
                                                In reply toKristoffer_Lo:
                                                Kristoffer Lo @Kristoffer_Lo
                                                  2022-12-19 10:30:25.936Z

                                                  @samuel_henriques would it be possible to further develop this script?
                                                  It would be cool to have the newly made AUX placed in to a basic folder called "MONITOR". And then for both the aux and the folder to adjust track height to micro.
                                                  I'm guessing it's getting pretty intricate now, I'm just curious.

                                                  Thank you again!

                                                  1. samuel henriques @samuel_henriques
                                                      2024-02-20 12:33:13.409Z

                                                      Hello Kristoffer_Lo,

                                                      Sorry for taking sooo long.

                                                      Do you still need this or another adaptation?