Switch to mix window and scroll into view
By Oren Hadar @Oren_Hadar
Hi all,
I'm trying to write a script that switches to the mix window and scrolls the currently selected track into view. My thinking is to select Window -> Mix and then ctrl-Shift click the currently selected track, but the scrolling part isn't working. What am I doing wrong?
sf.ui.proTools.menuClick({ menuPath: ['Window', 'Mix'] });
sf.ui.proTools.selectedTrack.titleButton.mouseClickElement({
isControl: true,
isShift: true,
});
- Christian Scheuer @chrscheuer2021-01-20 02:13:07.298Z
Hi Oren,
Unfortunately, SoundFlow's concept
selectedTrack
for now is only designed to work in the Edit window. We don't have any built-in actions for the Mix window. - In reply toOren_Hadar⬆:Raphael Sepulveda @raphaelsepulveda2021-01-20 04:10:17.618Z
Hey Oren!
While SoundFlow doesn't have functionality for the Mix window yet, we can still scroll to the currently selected track using PT's Scroll to Track dialog box, like so:
/**@param {string} trackName */ function ptScrollToTrack(trackName) { sf.ui.proTools.menuClick({ menuPath: ['Track', 'Scroll to Track...'] }); sf.ui.proTools.confirmationDialog.elementWaitFor(); sf.ui.proTools.confirmationDialog.textFields.first.elementSetTextFieldWithAreaValue({ value: trackName }); sf.ui.proTools.confirmationDialog.buttons.whoseTitle.is('OK').first.elementClick(); sf.ui.proTools.confirmationDialog.elementWaitFor({ waitType: 'Disappear' }); }; sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.mainWindow.invalidate(); // Get selected track name const selectedTrackName = sf.ui.proTools.selectedTrack.normalizedTrackName; // Switch to Mix Window sf.ui.proTools.menuClick({ menuPath: ['Window', 'Mix'] }); // Scroll to Track ptScrollToTrack(selectedTrackName);
Hope that helps!