Delete Empty Audio Tracks in Selection is not Working
System Information
SoundFlow 4.1.1
OS: darwin 18.7.0
ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G1012
Steps to Reproduce
- Just Run the comand
- Delelte 1 track
- Then stop deleting tracks and appears : Could not select track : Audio 3 ( Delete empty audio tracks in selection line 6)
- Didn't work any more
Expected Result
Delete all the empty tracks
Actual Result
Crash after the 2 track
Workaround
NO
Other Notes
Links
User UID: h7xUT7YLDvbiQ4zT4HYSpiXqsyk1
Feedback Key: sffeedback:h7xUT7YLDvbiQ4zT4HYSpiXqsyk1:-MHYDMeLecN-UnknoZfl
Linked from:
- Christian Scheuer @chrscheuer2020-09-23 11:14:29.179Z
Hi Juan,
Can you quote the script you're using here?
- In reply tochrscheuer⬆:JJuan david Chaparro Perez @Juan_david_Chaparro
Sure here it is the script
// Delete Empty Tracks sf.ui.proTools.appActivateMainWindow(); function processTrack(trackName) { sf.ui.proTools.trackSelectByName({ names: [trackName], deselectOthers: true }); if (sf.ui.proTools.selectedTrackNames[0] !== trackName) throw 'Could not select track: ' + trackName; //Refresh menu sf.ui.proTools.selectedTrack.trackScrollToView(); sf.ui.proTools.selectedTrack.titleButton.mouseClickElement(); var trackIsEmpty = sf.ui.proTools.getMenuItem('Track', 'Delete').exists; var trackIsAudioTrack = sf.ui.proTools.selectedTrack.title.value.indexOf('Audio Track') >= 0; if (trackIsEmpty && trackIsAudioTrack) { sf.ui.proTools.getMenuItem('Track', 'Delete').elementClick({}, 'Could not delete track: ' + trackName); } } function main() { var trackNames = sf.ui.proTools.selectedTrackNames.slice(); trackNames.map(processTrack); } main();
Christian Scheuer @chrscheuer2020-09-25 20:29:39.903Z
This should work :)
// Delete Empty Tracks sf.ui.proTools.appActivateMainWindow(); function processTrack(trackName) { sf.ui.proTools.trackSelectByName({ names: [trackName], deselectOthers: true }); if (sf.ui.proTools.selectedTrackNames[0] !== trackName) throw 'Could not select track: ' + trackName; //Refresh menu sf.ui.proTools.selectedTrack.trackScrollToView(); sf.ui.proTools.selectedTrack.titleButton.mouseClickElement(); var trackIsEmpty = sf.ui.proTools.getMenuItem('Track', 'Delete').exists; var trackIsAudioTrack = sf.ui.proTools.selectedTrack.title.value.indexOf('Audio Track') >= 0; if (trackIsEmpty && trackIsAudioTrack) { sf.ui.proTools.getMenuItem('Track', 'Delete').elementClick({}, 'Could not delete track: ' + trackName); sf.ui.proTools.invalidate(); } } function main() { var trackNames = sf.ui.proTools.selectedTrackNames.slice(); trackNames.map(processTrack); } main();
Christian Scheuer @chrscheuer2020-09-25 20:30:05.398Z
Thanks for helping us solve this issue :)
- JJuan david Chaparro Perez @Juan_david_Chaparro
Didn't work either.
Actually right now is no Deleting any tracks at all.
Thanks in advance
Christian Scheuer @chrscheuer2020-09-25 20:54:39.110Z
The script is designed to only delete any empty tracks that were selected. So make sure to select all tracks you want the script to consider for deletion before running it :)
- JJuan david Chaparro Perez @Juan_david_Chaparro
It worked .
Thanks. :)
Christian Scheuer @chrscheuer2020-09-25 21:40:02.166Z
Awesome :)
- MIn reply toJuan_david_Chaparro⬆:Matt Friedman @Matt_Friedman
I was having a similar sort of issue with this one but I think I fixed it by also adding
sf.ui.proTools.invalidate();
to the beginning, just aftersf.ui.proTools.appActivateMainWindow();