Question: Is it possible to deselect a specific track while keeping others selected?
Heyo everyone, back at it with yet another somewhat niche question.
I stumbled across the thread Is there a way to deselect a track?
However, unfortunately nowhere in there (or anywhere else) did I find an answer to this specific scenario.
If, for instance, someone were to have an array of tracks selected (for example, 'Audio Track 1' through 'Audio Track 20') how could we specifically deselect one track (for example, 'Audio Track 12') so that the remaining 19 tracks would still be selected?
Is there currently any way to achieve this using SoundFlow?
- Mitch Willard @Mitch_Willard
Hi @Eric_Huergo
Here you go.
This will give you a pop up menu to choose which track within the selection you want to deselect from your selection.
function deselectTrackInsideSelection() { const sup = sf.ui.proTools; function scrollToTrack(trackName) { let confirmationDlg = sup.confirmationDialog; sup.menuClick({ menuPath: ["Track", "Scroll to Track..."] }); confirmationDlg.elementWaitFor({ waitType: "Appear", pollingInterval: 200 }); confirmationDlg.textFields.first.elementSetTextFieldWithAreaValue({ value: trackName, }); confirmationDlg.buttons.whoseTitle.is("OK").first.elementClick(); }; sup.appActivateMainWindow(); var originalSelectedTracks = sup.selectedTrackNames; var trackToDeselect = sf.interaction.popupSearch({ items: originalSelectedTracks.map(trackName => ({ name: trackName })), columns: [ { name: 'Choose Track to REMOVE from selection.', key: 'name', width: 100 } ], }).item.name scrollToTrack(trackToDeselect); sup.trackSelectByName({ names: originalSelectedTracks }); sup.trackGetByName({ name: trackToDeselect }).track.titleButton.mouseClickElement({ isCommand: true, }); var newSelectedTracks = sup.selectedTrackNames; scrollToTrack(originalSelectedTracks[0]); sup.trackSelectByName({ names: newSelectedTracks }); }; deselectTrackInsideSelection();
Cheers
Mitch
Eric Huergo @Eric_Huergo
Thank you so much @Mitch_Willard !!!
I think I should definitely be able to adapt this into my script!
Appreciate you! :)
- In reply toMitch_Willard⬆:PPhilip weinrobe @Philip_weinrobe
is there a way to get a simpler version of this process that doesn't involve asking the user to choose which tracks to deselect?
I have a process where the tracks to deselect never change. i just want to input their names and have them deslected automatically from a previous selection (keeping all other selected tracks selected).basically, exactly what this script does, but pre-defining the tracks to deselect.
thank you!
philipMitch Willard @Mitch_Willard
There totally is!
function removeTrackFromSelection(track) { var verifyTrackList = sf.ui.proTools.selectedTrackNames; let doesTrackExist = (verifyTrackList.filter(n => n === track)[0] === track); if (doesTrackExist) { sf.ui.proTools.trackSelectByName({ names: verifyTrackList.filter(n => n != track) }); }; }; /////Add your track to deselect here removeTrackFromSelection('Your Track Name Goes Here');
Cheers
Mitch