Hey Guys,
I built a script to load a track preset and then move selected tracks to a certain folder. The problem is Pro Tools de-selects the tracks (except for the last one) once it loads the track preset. So then the script only moves one track to the folder. Id really love to have this all in one Stream deck button because I have 17 of these to organize tracks into my mix template. So a 2 step process would mean having 34 buttons to do it =( Is there a way to make the script wait until I re-select the tracks? like drag and highlight the tracks then on the mouse button release it then continues the script?
and I can't reverse the steps because if it moves the tracks to the folder first the second part of the script can't work if the selected tracks arent in view.
Any thoughts on a way to automate this? or add a user defined step in the middle of a macro? Or am I just doomed to have this be a 2 step process
Heres one of the 17 scripts just for reference:
sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({
isRightClick: true,
menuPath: ['Recall Track Preset', '2.0 Template', 'ST_03 HiPrc']
});
sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({
isRightClick: true,
isOption: true,
isShift: true,
menuPath: ['Move to...', 'Hi Perc Grp']
});
- Dustin Harris @Dustin_Harris
Hi Michael!
Try this and let me know if it fixes it?//store the currently selected track names in the variable "selectedTracks" let selectedTracks = sf.ui.proTools.selectedTrackNames; sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ isRightClick: true, menuPath: ['Recall Track Preset', '2.0 Template', 'ST_03 HiPrc'] }); //reselect the tracks that were selected at the beginning of the script sf.ui.proTools.trackSelectByName({names: selectedTracks}) sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ isRightClick: true, isOption: true, isShift: true, menuPath: ['Move to...', 'Hi Perc Grp'] });
- MMichael Bouska @Michael_Bouska
Oh wow this looks really promising! It didn't work... but I wonder if its because pro tools has a bit of a lag time to load the presets, especially if you have a lot of tracks selected. I wonder if I build it a wait time with a macro?
Dustin Harris @Dustin_Harris
Yeah, to be fair I haven't tested it myself, and I don't really use presets, but let me mess with it a bit and come back with something a little more refined :)
- In reply toMichael_Bouska⬆:
Dustin Harris @Dustin_Harris
Ok this is a bit of a hack, but it might work until I can figure out a better way to ensure the presets are done loading on the tracks...
sf.ui.proTools.appActivateMainWindow(); let selectedTracks = sf.ui.proTools.selectedTrackNames; sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ isRightClick: true, menuPath: ['Recall Track Preset', '2.0 Template', 'ST_03 HiPrc'] }); while (true) { sf.wait({intervalMs:200}) if (sf.ui.proTools.invalidate().selectedTrackNames[0] === selectedTracks[selectedTracks.length - 1]) break; } sf.wait(); sf.ui.proTools.trackSelectByName({names: selectedTracks}) sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ isRightClick: true, isOption: true, isShift: true, menuPath: ['Move to...', 'Hi Perc Grp'] });
- MMichael Bouska @Michael_Bouska
Thanks! Really appreciate the help! It still doesn't want to re-select the tracks after loading the preset :( I tried ramping up the wait interval too because pro tools does take a few seconds to load the preset, even longer if im selecting 10+ tracks (Im even on a 2020 Mac Pro and its still sluggish =( haha)
Chris Shaw @Chris_Shaw2021-03-02 01:03:26.007Z
This is very odd behavior. The script works on my system even without the waits and
while
loop.Dustin Harris @Dustin_Harris
There is a bit of a pause on my system as well. If you interrupt the script with an
alert()
its called before protools is finished setting the presets...- MMichael Bouska @Michael_Bouska
Hey Guys!
Actually, both those seem to work great! I think sometimes I need to restart SoundFlow for new scripts to work? Anyways, thanks for the help! You guys rock! - In reply toDustin_Harris⬆:MMichael Bouska @Michael_Bouska
Hey Dustin,
Finally started to use this script with my session prep. Oddly it works GREAT the first time, but subsequent times it re-selects the wrong tracks and sends those to the folder. Usually above the ones I had selected. If I quit SoundFlow and restart it, it'll do the first one correct again and then the next time it gets confused. any idea what's going on?Thank you!!
Dustin Harris @Dustin_Harris
Ooh that sounds like a stale track cache... try changing the second line of the script above to this:
let selectedTracks = sf.ui.proTools.invalidate().selectedTrackNames;
Let me know if that does the trick :)
- MMichael Bouska @Michael_Bouska
Amazing! Works like a charm now!! Thank you!