How to commit tracks (and more)
How do I find script for making a track "commit" and to "quantize midi" in Pro Tools?
- Christian Scheuer @chrscheuer2021-06-07 15:58:55.898Z
Hi Paul,
If these are available as menu items, you should be able to create a macro for this, then add the Click Menu Item action :)
- MIn reply toPaul_Fraser⬆:Martin Pavey @Martin_Pavey
Here's a simple script to commit a selection.
I hope it helps.sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ menuPath: ['Commit...'], isRightClick: true, }); sf.wait(1500); sf.ui.proTools.windows.whoseTitle.is('Commit Tracks').first.popupButtons.whoseTitle.is('Selected Tracks').first.popupMenuOpenFromElement({ executionMode: "Background", }); sf.keyboard.press({ keys: "down, return", executionMode: "Background", }); var dlg = sf.ui.proTools.windows.whoseTitle.is('Commit Tracks').first.elementWaitFor().element; dlg.buttons.whoseTitle.is('OK').first.elementClick(); dlg.elementWaitFor({ waitForNoElement: true });
- PPhilip weinrobe @Philip_weinrobe
is it possible to expose some more of the commit dialog window in this script so i can edit it to make different versions of commit (sometimes i want to hide and make inactive, sometimes i want do nothing, etc etc)
would be great just to get the above parameter exposed in the script so we can edit. thank you!!
Chris Shaw @Chris_Shaw2021-09-22 20:48:18.139Z2021-09-22 21:48:27.693Z
try this (or the script below this):
sf.ui.proTools.appActivate(); // Declare action to take after commiting (Change to desired action) var afterCommit = "Hide and Make Inactive" //Open and wait for commit dialog window sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ menuPath: ['Commit...'], isRightClick: true, }); // Define commit window element var commitWin = sf.ui.proTools.windows.whoseTitle.is('Commit Tracks').first commitWin.elementWaitFor().element; // Commit Select "Selected Tracks" commitWin.popupButtons.whoseDescription.is("").first.popupMenuSelect({ menuPath: ["Selected Tracks"], }); // Set after commit action commitWin.popupButtons.whoseDescription.is("").allItems[1].popupMenuSelect({ menuPath: [afterCommit], }); // Commit Tracks commitWin.buttons.whoseTitle.is('OK').first.elementClick();
Chris Shaw @Chris_Shaw2021-09-22 21:42:24.464Z2021-09-22 22:58:44.152Z
Here's a version that will let you set all options in the Commit window and works with multiple tracks:
// Declare commit window options (Change as needed) var commitCheckBoxes = { "Consolidate Clips": "Enable", // Render Automation: "Volume and Mute": "Disable", "Pan": "Disable", // Copy: "Sends": "Enable", "Group Assignments": "Enable", "Insert after last selected track": "Enable", "Offline": "Enable", }; // Declare commit window drop down menus (Change as needed) var commitPopupMenus = { Commit: "Selected Tracks", SourceTracks: "Hide and Make Inactive" }; function commitTrack(commitCheckBoxes, commitPopupMenus) { //Open Commit Dialog window sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ menuPath: ['Commit...'], isRightClick: true, }); var commitWin = sf.ui.proTools.windows.whoseTitle.is('Commit Tracks').first commitWin.elementWaitFor().element; // Set checkBoxes for (var cbItem in commitCheckBoxes) { commitWin.checkBoxes.whoseTitle.is(cbItem).first.checkboxSet({ targetValue: commitCheckBoxes[cbItem] }); }; // Set Commit Menu commitWin.popupButtons.whoseDescription.is("").first.popupMenuSelect({ menuPath: [commitPopupMenus.Commit], }); // Set Source Tracks action commitWin.popupButtons.whoseDescription.is("").allItems[1].popupMenuSelect({ menuPath: [commitPopupMenus.SourceTracks], }); // Commit Tracks commitWin.buttons.whoseTitle.is('OK').first.elementClick(); sf.ui.proTools.waitForNoModals(); }; // Main sf.ui.proTools.appActivate(); sf.ui.proTools.mainWindow.invalidate(); // Get selected track names / check that tracks are selected const origSelectedTracks = sf.ui.proTools.selectedTrackNames if (origSelectedTracks.length == 0) { sf.interaction.notify({ title: "Commit Tracks", message: "No tracks selected" }); throw 0; }; // Commit selected tracks origSelectedTracks.forEach(track => { sf.ui.proTools.trackSelectByName({ names: [track] }); sf.ui.proTools.selectedTrack.trackScrollToView(); commitTrack(commitCheckBoxes, commitPopupMenus); sf.ui.proTools.mainWindow.invalidate(); }); // Re-select original selected tracks sf.ui.proTools.trackSelectByName({ names: origSelectedTracks });
- PPhilip weinrobe @Philip_weinrobe
thanks chris!
- PPhilip weinrobe @Philip_weinrobe
seems this cycles through the tracks. can it instead keep tracks selected when bringing up the commit dialog and then hitting ok? if it keeps tracks selected then all will be done at the same time.
- In reply toChris_Shaw⬆:PPhilip weinrobe @Philip_weinrobe
actually, the earlier simpler script you posted is excatly what i need and working perfectly. all set! thanks chris
- In reply toChris_Shaw⬆:PPhilip weinrobe @Philip_weinrobe
Hey Chris,
Do you think you could help me tweak this just a bit?
Below is my code that works perfect for setting a few variables than committing multiple tracks at once. However, i would like to expose and be able to edit all variables, like your above code.
Could you help show me how to bring all those variables into my script? I tried..but failed.//https://forum.soundflow.org/-5020/how-to-commit-tracks-and-more// // fucking around// sf.ui.proTools.appActivate(); // Declare action to take after commiting (Change to desired action) var afterCommit = "Do Nothing" //Open and wait for commit dialog window sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ menuPath: ['Commit...'], isRightClick: true, }); // Define commit window element var commitWin = sf.ui.proTools.windows.whoseTitle.is('Commit Tracks').first commitWin.elementWaitFor().element; // Commit Select "Selected Tracks" commitWin.popupButtons.whoseDescription.is("").first.popupMenuSelect({ menuPath: ["Edit Selection"], }); // Set after commit action commitWin.popupButtons.whoseDescription.is("").allItems[1].popupMenuSelect({ menuPath: [afterCommit], }); // Commit Tracks commitWin.buttons.whoseTitle.is('OK').first.elementClick();
Chris Shaw @Chris_Shaw2024-01-29 16:32:54.606Z
//https://forum.soundflow.org/-5020/how-to-commit-tracks-and-more// // fucking around// sf.ui.proTools.appActivate(); // Declare commit window options (Change as needed) var commitCheckBoxes = { "Consolidate Clips": "Enable", // Render Automation: "Volume and Mute": "Disable", "Pan": "Disable", // Copy: "Sends": "Enable", "Group Assignments": "Enable", "Insert after last selected track": "Enable", "Offline": "Enable", }; // Declare commit window drop down menus (Change as needed) var commitPopupMenus = { Commit: "Selected Tracks", SourceTracks: "Hide and Make Inactive" }; function commitTracks(commitCheckBoxes, commitPopupMenus) { //Open Commit Dialog window sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ menuPath: ['Commit...'], isRightClick: true, }); var commitWin = sf.ui.proTools.windows.whoseTitle.is('Commit Tracks').first commitWin.elementWaitFor().element; // Set checkBoxes for (var cbItem in commitCheckBoxes) { commitWin.checkBoxes.whoseTitle.is(cbItem).first.checkboxSet({ targetValue: commitCheckBoxes[cbItem] }); }; // Set Commit Menu commitWin.popupButtons.whoseDescription.is("").first.popupMenuSelect({ menuPath: [commitPopupMenus.Commit], }); // Set Source Tracks action commitWin.popupButtons.whoseDescription.is("").allItems[1].popupMenuSelect({ menuPath: [commitPopupMenus.SourceTracks], }); // Commit Tracks commitWin.buttons.whoseTitle.is('OK').first.elementClick(); sf.ui.proTools.waitForNoModals(); }; //////// //MAIN// //////// commitTracks(commitCheckBoxes, commitPopupMenus);
- PPhilip weinrobe @Philip_weinrobe
thanks chris!
the pop-up menus don't seem to work..."edit selction" and the "do nothing/make inactive" parts.
everything else seems to be reading correctly...- PPhilip weinrobe @Philip_weinrobe
weird cause i see it try to change that first pop up, but it doesn't seem to fully do it...
- PPhilip weinrobe @Philip_weinrobe
here is error:
29.01.2024 11:48:59.61 [Backend]: !! Command Error: COMMIT TEST ALL VARIABLES [user:default:clrz4250a00047q10wsla4ry4]:
Could not open popup menu (COMMIT TEST ALL VARIABLES: Line 51)
Popup menu was not found
Popup window was not found after waiting 2000 msChris Shaw @Chris_Shaw2024-01-29 17:38:01.575Z
Have you changed the settings? (ie lines 23 and 24) to the desired settings? Are they spelled correctly? All variation of the setting work on my setup (2023.12 / Ventura)
Chris Shaw @Chris_Shaw2024-01-29 17:39:34.338Z
Edit selection wont work (menu greyed out) unless a selection is made.
- In reply toChris_Shaw⬆:PPhilip weinrobe @Philip_weinrobe
yeah, def spelled correctly.
i am running 2023.9/Ventura bc there were some other soundflow issues in 2023.12...but maybe it's time to step up and deal with them.will report back from 2023.12
- In reply toChris_Shaw⬆:BBrandon Jiaconia @Brandon_Jiaconia
Every time I go looking for something you have me sorted! Thanks Chris!!
- In reply toMartin_Pavey⬆:PPhilip weinrobe @Philip_weinrobe
this script is amazing, by the way. saving me a TON of time and really allowing me to get creative with outboard performances now that it's sooo easy to capture them with one click