New Playlist & Duplicate Playlist
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
Chris Shaw @Chris_Shaw2023-03-29 20:34:23.959Z2023-03-29 22:56:52.486ZThis 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
- In reply toChris_Shaw⬆:MMitch Lee @Mitch_Lee
I tried this script however I get the following error.
Running Pro Tools Ultimate 2025.10.0Link to .log file
https://www.dropbox.com/scl/fi/35pqxgonujdgn4bq26ngm/soundflow.20260120.main.log?rlkey=a46ilsp84m0w1yjc107sxfb7l&dl=0
Chris Shaw @Chris_Shaw2026-01-20 18:08:58.263Z2026-01-20 21:54:26.286ZFor PT 25.10 and higher replace "New…" with "New Playlist" and "Duplicate…" with "Duplicate Main Playlist"
- MMitch Lee @Mitch_Lee
Great! that works.
- In reply toChris_Shaw⬆:HHelder Hans @Helder_Hans
Hi Chris,
the "OK" button is not working anymore.
I had to change line 38 for this to work:sf.ui.proTools.focusedWindow.buttons.whoseTitle.is("OK").first.elementClick()