5.8 Problem with trackDelete();
So ive seen this in two scripts so far since I updated to 5.8
sf.ui.proTools.trackDelete();
seems to be not working?
So ive tried this
selectAllTracksStartingWith("F N-")
sf.ui.proTools.menuClick({
menuPath: ["Track", "Delete"],
});
try {
sf.ui.proTools.confirmationDialog.elementWaitFor();
sf.ui.proTools.confirmationDialog.buttons.whoseTitle.is("Keep").first.elementClick();
sf.ui.proTools.confirmationDialog.elementWaitFor({ waitType: "Disappear" });
}
catch (err) {
sf.keyboard.press({ keys: 'enter', });
}
sf.ui.proTools.invalidate
trackNames = sf.ui.proTools.trackNames;
sf.ui.proTools.waitForNoModals();
which also doesn't seem to be working (the above code is part of a larger script with this part handling deleting some temporary folder tracks)
I noticed the delete option in the menu does seem to change between Delete and Delete... I've tried using an if statement to check which menu item is present and clicking that one but it always returned Delete in my case and didn't work.
Ive also tried putting it in a while loop looking for certain tracks to exist but it just continually goes through the loop selecting the tracks.
In all of the above I get no errors in the log that it cant click the menu item just nothing happens
I must be doing something hyper stupid right?
Thanks in advance!
Jack
Linked from:
- Jack Green @Jack_Green
Got a friend to test the above code and it isn't working for him on 7.8 either...
It weird as that part of the script has been working flawlessly for months.
- In reply toJack_Green⬆:Chad Wahlbrink @Chad2024-07-17 16:06:14.441Z
Hey @Jack_Green!
sf.ui.proTools.trackDelete();
appears to function normally on SF 5.8.0 on my machine.
Running the other code you shared doesn't work for me because the functionselectAllTracksStartingWith()
and the variabletrackNames
are not defined in that code snippet.
The best way to help with this kind of issue would be to create a single script with just:sf.ui.proTools.trackDelete();
Then click the red "Need Help" button and select "Get help with this script"
That way, we can access more of your system information, logs, etc., and help you troubleshoot from there.
Best,
ChadJack Green @Jack_Green
Thanks for replying.
Sorry I Only posted part of the snippet I had exported into a new script doing as you described above just getting that part working.
I think ive managed to get it working today by using
sf.keyboard.press({ keys: 'left' });
to "reset" the menus after the track select.
Full code..
function selectAllTracksStartingWith(startString) { var trackNames = sf.ui.proTools.trackNames; var startsWith = trackNames.filter(name => name.startsWith(startString)); sf.ui.proTools.trackSelectByName({ names: startsWith }); } sf.ui.proTools.appActivateMainWindow(); var trackNames = sf.ui.proTools.trackNames selectAllTracksStartingWith("F N-") sf.keyboard.press({ keys: 'left' }); sf.ui.proTools.menuClick({ menuPath: ["Track", "Delete"], }); try { sf.ui.proTools.confirmationDialog.elementWaitFor(); sf.ui.proTools.confirmationDialog.buttons.whoseTitle.is("Keep").first.elementClick(); sf.ui.proTools.confirmationDialog.elementWaitFor({ waitType: "Disappear" }); } catch (err) { sf.keyboard.press({ keys: 'enter', }); } sf.ui.proTools.invalidate trackNames = sf.ui.proTools.trackNames; sf.ui.proTools.waitForNoModals();
Thanks again for your help
Jack
Chad Wahlbrink @Chad2024-07-18 15:40:17.082Z
Thanks for this, Jack!
One small note on the above script. In line 30,sf.ui.proTools.invalidate
will not run an invalidate method because it is missing the()
. This line must besf.ui.proTools.invalidate()
to perform an invalidate action.
- MIn reply toJack_Green⬆:Matt Friedman @Matt_Friedman
I noticed the delete option in the menu does seem to change between Delete and Delete... I've tried using an if statement to check which menu item is present and clicking that one but it always returned Delete in my case and didn't work.
Just FYI:
If any tracks have data on them (audio) you'll seeDelete...
If all selected tracks are empty you'll seeDelete
The...
indicates there will be dialogs to come, such as the dialog that there is audio on the tracks you're about to delete. - In reply toJack_Green⬆:Chad Wahlbrink @Chad2024-07-18 15:23:33.038Z2024-07-18 15:42:50.414Z
Thanks for providing the full script in this post, @Jack_Green!
I can reproduce the issue you see in SF 5.8.0 by usingsf.ui.proTools. trackSelectByName()
and then trying to perform actions from the Track Menu, like Track > Delete.
In 5.7.8, usingsf.ui.proTools. trackSelectByName()
will select the track(s), and the Track menu will update accordingly to allow the tracks to be deleted, etc. In 5.8.0, the Track menu is not updated after track selection, meaning no actions can be taken from the Track menu on the selected tracks. Invalidating also does not work in this instance, but you are correct that asf.keyboard.press({ keys: 'left' });
seems to jog the UI to update correctly.
Thanks for pointing this out, Jack! In the future, I suggest using the Macro/Script Help workflow for this kind of issue so that we can access the logs and the full script in question. Regardless, this is helpful to know!
Also, noting this is likely the same issue noted here: Trackselectbyname causes Edit Menu to grey out
- SIn reply toJack_Green⬆:SoundFlow Bot @soundflowbot
This issue is now tracked internally by SoundFlow as SF-1368
- SIn reply toJack_Green⬆:SoundFlow Bot @soundflowbot
Linked issue SF-1368 updated: This should be fixed in the next release of SoundFlow.
- SIn reply toJack_Green⬆:SoundFlow Bot @soundflowbot
The linked internal issue SF-1368 has been marked as Done