Populating the Bounce to Disk file name from the session name.
Desired Workflow
Question
Hello
I am building a script to simplify the process of bouncing stems out from a large multitrack. I’ve got an excellent workflow going here where I group tracks to a VCA per stem and simply bounce to disk over and over while solo’ing each next VCA in the process.
I’d like to streamline the naming scheme though. So, I believe I’d create a variable for each stem’s name from the session name minus the final text segment as follows:
var sessionPath = sf.ui.proTools.mainWindow.sessionPath;
var sessionName = sessionPath.split('/').slice(-1)[0].split('.').slice(0, -1).join('.');
var sessionBaseName = sessionName.split('').slice(0, -1).join('');
log(sessionBaseName);
//And then solo the Stem’s VCA to bounce:
sf.ui.proTools.trackGetByName({ name: "Stem1", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
//And then in the Bounce to Disk window I enter the following:
sf.keyboard.press({
keys: "cmd+alt+b, tab, backspace,
});
//AND THEN HOW DO I ENTER THE sessionBaseName at this point?
//And secondly, is it possible to pluck the text from comments of this solo’ed VCA track to add to the name as well?
Command Info
ID: user:default:ckc0yv6et000g461083p55v1f
Name: (tb Macro) Stem Bouncer JS
Source
//This is my stem bouncer. It relies on a user having up to 20 VCAs as the first tracks in the session (named Stem1, Stem2, Stem3, etc). The user then bypasses all existing groups and creates new groups per stem that are controlled by the corresponding VCA. User must also solo safe all effects returns etc. This script does a bounce of the entire session (no solo’ed VCAs) and labels the resulting file (SessionName_2Mix). Next it solos VCA1, bounces to disk naming the resulting file as follows: (SessionName_Stem#). The moves to VCA 2, etc.
// Clear Solos
sf.ui.proTools.appActivateMainWindow()
sf.ui.proTools.mainWindow.counterDisplay.mouseClickElement({
relativePosition: { x: 299, y: 67 }
});
//Bounce to Disk - 2Mix
sf.keyboard.press({
keys: "cmd+alt+b, tab, backspace, 2, shift+m, i, x"
});
sf.ui.proTools.waitForNoModals();
//Bounce to Disk - Stems
sf.ui.proTools.trackGetByName({ name: "Stem1", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 0, 1, shift+minus, return",
});
sf.keyboard.press({
keys: "return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem2", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 0, 2, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem3", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 0, 3, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem4", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 0, 4, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem5", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 0, 5, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem6", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 0, 6, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem7", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 0, 7, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem8", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 0, 8, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem9", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 0, 9, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem10", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 1, 0, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem11", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 1, 1, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem12", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 1, 2, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem13", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 1, 3, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem14", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 1, 4, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem15", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 1, 5, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem16", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 1, 6, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem17", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 1, 7, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem18", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 1, 8, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem19", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 1, 9, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
sf.ui.proTools.trackGetByName({ name: "Stem20", makeVisible: true }).track.trackSetSolo({
targetValue: "Enable",
});
sf.keyboard.press({
keys: "cmd+alt+b, tab, shift+s, t, e, m, 2, 0, shift+minus, return",
});
sf.ui.proTools.waitForNoModals();
//Clear All Solos
sf.ui.proTools.appActivateMainWindow();
sf.ui.proTools.mainWindow.counterDisplay.mouseClickElement({
relativePosition: { x: 299, y: 67 }
});
Links
User UID: KxRWDJecRbcDlosrVAZoPUa3pod2
Feedback Key: sffeedback:KxRWDJecRbcDlosrVAZoPUa3pod2:-MB29QjdXuhkjMTpfcbQ
- Christian Scheuer @chrscheuer2020-06-30 09:30:57.413Z
Hi Todd!
Impressive progress / work here :)
Have you seen my videos on how to move from Keyboard simulation to UI automation?
I think you'd be inspired to move away from some of these manual keyboard steps.Generally, to type text you should use
sf.keyboard.type
instead ofsf.keyboard.press
.For example, this:
sf.keyboard.press({ keys: "cmd+alt+b, tab, shift+s, t, e, m, 0, 1, shift+minus, return", });
Should be something like this:
sf.keyboard.press({ keys: "cmd+alt+b, tab", }); sf.keyboard.type({ text: "Stem01", }); sf.keyboard.press({ keys: "return", });
Then, swapping out to use a variable in place of the hard coded string is easy.
Christian Scheuer @chrscheuer2020-06-30 09:32:40.246Z
This is the playlist on YouTube with the videos in question.
https://www.youtube.com/playlist?list=PLKWpZOwx5Z3jxnpNo_dQPhDQNRwp7DCNjParticularly, make sure to watch these 2:
Todd Burke @Todd_Burke8
My other question I can't seem to find as a macro or anywhere in the forum here either...
How do I create a variable which grabs the text that a user has entered in the comments field of a selected track?
Thanks!
Christian Scheuer @chrscheuer2020-06-30 17:46:27.164Z
Hi Todd - can I get you to file this as a separate question? Then it will be easier for people to find the solution in the future :)
- In reply tochrscheuer⬆:
Todd Burke @Todd_Burke8
Thanks so much! This is JS Day 1 for me :) I'll watch the videos for sure....