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:
- Add a send to a selected track
- Name the send
- 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?
- samuel henriques @samuel_henriques
Hello Kristoffer,
Which send slot would you like to use? Starting on 1 or first available, or you have designated slots for this?
- KIn reply toKristoffer_Lo⬆:Kristoffer Lo @Kristoffer_Lo
Hi Samuel, thanks for your response.
Just the first available.
Thanks!
samuel henriques @samuel_henriques
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();
- KKristoffer Lo @Kristoffer_Lo
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
samuel henriques @samuel_henriques
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"] }, ];
samuel henriques @samuel_henriques
New Update, minor fixes.
- KKristoffer Lo @Kristoffer_Lo
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.samuel henriques @samuel_henriques
Sorry, I misunderstood, just updated with a fix.
- Ooleg baranov @oleg_baranov6
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
samuel henriques @samuel_henriques
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.- Ooleg baranov @oleg_baranov6
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.samuel henriques @samuel_henriques
indeed, my apologies. It wasn't working.
Just updated, try now please.- Ooleg baranov @oleg_baranov6
@samuel_henriques thanks a lot! The script works p e r f e c t l y.
Life couldn't be better.
- KIn reply toKristoffer_Lo⬆:Kristoffer Lo @Kristoffer_Lo
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)"samuel henriques @samuel_henriques
Just noticed where it could be wrong, my bad. give me a bit and I'll fix it
- In reply toKristoffer_Lo⬆:
samuel henriques @samuel_henriques
UPDATED, with a fix.
- KKristoffer Lo @Kristoffer_Lo
Thank you so much, @samuel_henriques - this works like an absolute charm!
- KIn reply toKristoffer_Lo⬆:Kristoffer Lo @Kristoffer_Lo
@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!
samuel henriques @samuel_henriques
Hello Kristoffer_Lo,
Sorry for taking sooo long.
Do you still need this or another adaptation?