New Playlist & Duplicate Playlist
By John McPhillips @John_McPhillips
Hi All - does anyone know if there's a macro/script for creating a new playlist or duplicating current playlist when a track is selected?
Thanks
John
Linked from:
- Chris Shaw @Chris_Shaw2023-03-29 20:34:23.959Z2023-03-29 22:56:52.486Z
This script will create a new playlist for selected tracks.
Read the comments to modify it to duplicate trackssf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.mainWindow.invalidate(); // substitute "New..." with "Duplicate..." to duplicate track const trackAction = "New..." //Get selected Track Names const originalSelectedTracks = sf.ui.proTools.selectedTrackNames; //Select first track and make sure it is scrolled into view sf.ui.proTools.trackSelectByName({ names: [originalSelectedTracks[0]] }) sf.ui.proTools.selectedTrack.trackScrollToView() //Reselect originally selected tracks sf.ui.proTools.trackSelectByName({ names: originalSelectedTracks }) //Duplicate or Create New Tracks depending on value of `trackAction` sf.ui.proTools.selectedTrack.popupButtons.whoseTitle.is("Playlist selector").first.popupMenuSelect({ isShift: true, isOption: true, menuPath: [trackAction] }) //Delete everything below this line if you want to name the playlist //otherwise the script will automatically click "OK" to close confirmation dialog //If only one track is originally selected, wait for the confirmation dialog sf.wait({ intervalMs: 300 }) const confDialog = sf.ui.proTools.confirmationDialog //close conmf dialog if (confDialog.exists && originalSelectedTracks.length == 1) { sf.ui.proTools.windows.first.buttons.whoseTitle.is("OK").first.elementClick() }
- JJohn McPhillips @John_McPhillips
Hi Chris - thank you so much, this is exactly what I was after. I'm hopeless at coding/scripting... One day, one day I'll knuckle down and save you all this bother.
Cheers
John