get selected track, "clipboard" clear?
Hi,
I'm trying to create a command which cuts a clip on a track "eg, og track", goes to a specific track "eg, dx 1," paste the clip, goes back to the original track "og track" and deletes it.
I use the "get selected track" command in order to grab the selected track name. The problem is that this name seems to stay in some kind of memory or clipboard, which then prevents me from using this command again. It will no longer let me use this command until I restart soundflow.
Is there a way to clear the data acquired in "get selected track"?
- OOwen Granich-Young @Owen_Granich_Young
You want to delete the whole track? Or just the delete the cilp from the original track?
If it's the latter check out my 'aaf organizer' package in the store.
The 'Paste to Track Variable Track Count' Template is I believe what you're trying to do?
Otherwise, sharing your scirpt here will enable people to better understand what you're looking to do and help you.
Bests,
Owen- B@briannaas
Ah, that's perfect I didn't know that package existed. Yes, this does exactly what I'm trying to do for session import.
Thanks!
- In reply tobriannaas⬆:Chris Shaw @Chris_Shaw2022-04-13 22:13:18.667Z
I'm not 100% sure if this is the workflow you're looking for but this script should do it.
It will copy the currently selected clip from the currently selected track, paste it to a predefined destination track (change the name for your needs), then deletes it from the source track.
You can undo the deletion if you want.sf.ui.proTools.mainWindow.invalidate(); const destinationTrack = "Audio 1"; const sourceTrack = sf.ui.proTools.selectedTrack.normalizedTrackName; //Ensure source track is displaying waveform const trackDisplayBtn = sf.ui.proTools.selectedTrack.displaySelectorButton if (trackDisplayBtn.value.invalidate().value != "waveform") { trackDisplayBtn.popupMenuSelect({ isRightClick: true, menuPath:["waveform"] }) }; // Copy Clip sf.ui.proTools.menuClick({ menuPath: ["Edit", "Copy"] }) // Go to destination track sf.ui.proTools.trackSelectByName({ names: [destinationTrack] }); // Paste Clip sf.ui.proTools.menuClick({ menuPath: ["Edit", "Paste"] }); //Go to source track sf.ui.proTools.trackSelectByName({ names: [sourceTrack],deselectOthers:true }); sf.wait ({intervalMs:150}) //Delete Clip sf.ui.proTools.menuClick({ menuPath: ["Edit", "Cut"] });