Select next Audio track exclude folders
I'm trying to group and region mute each audio track individually for my M&E workflow.
I want to select a region at the top of my session and then Move Edit Selection Down to next track, Clip Group, Mute region and then repeat Move Edit Selection Down to next track, Clip Group, Mute region.
I have it all programmed with "Press Key" Macros but when it gets to folder tracks it mutes the folder which in turn mutes all the tracks in the folder.
Is there a way i can select audio tracks ONLY individually clip group mute region?
Thanks in advance!
- Chris Shaw @Chris_Shaw2023-04-05 23:22:23.556Z2023-04-08 23:22:21.565Z
Without seeing your script the only thing I can offer is this bit of code that checks if the selected track is an audio track:
if (sf.ui.proTools.selectedTrackHeaders[0].title.value.includes("- Audio Track")){ //Insert your code for Clip Group, Mute region here //Don't leave out the bracket below this line }
Brenden @nednednerb
Are you missing one parenthesis? Should the opening after "if" be closed as follows?
...("-Audio Track")){...
Chris Shaw @Chris_Shaw2023-04-08 23:22:46.004Z
Yep. Fixed.
Thanks!
- In reply toChris_Shaw⬆:AAlbert Romero @Albert_Romero
So i'm not proficient at writing script yet. I just used keyboard press record. here is what it looks like. Can you integrate exclude folder tracks to the workflow?
sf.keyboard.press({
keys: "a",
});sf.keyboard.press({
keys: "semicolon",
});//Calling command "Repeat N Times" from package "undefined" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ckuxffxq80000u010m7g02u3l/ckykkhblv00005010vnzhi0gm")
sf.soundflow.runCommand({
commandId: 'user:ckuxffxq80000u010m7g02u3l:ckuxg4i32000cu010dk8ldgm3',
props: {
repetitions: 30,
}
});Thanks for your help!!!!
Chris Shaw @Chris_Shaw2023-04-10 18:27:22.369Z
Hey Albert,
I'm not sure what the "Repeat N Times" script command actually does.
If you could describe, step by step exactly what you're trying to do, I could come up with a script.From what you have described - are you trying to:
- select an audio track
- select all clips on the audio track
- group all of the audio clips
- mute the newly created audio group
- move on to the next audio track and do the same as described above
- do this for all audio tracks in the session
is this right?
- AAlbert Romero @Albert_Romero
Hi Chris,
Thanks for all your help!
below is what i am looking for.Select video clip to get selection length (always at the top of the session)
Move Edit Selection to next audio track
clip group all of the audio based on selected length
mute the newly created audio group
move on to the next audio track and do the same as described above
do this for all audio tracks in the sessionChris Shaw @Chris_Shaw2023-04-12 20:55:32.929Z2023-04-14 17:07:52.569Z
This should do it.
Make sure the video is selected before running the script - it doesn't need to be the first track.
The script will skip any audio track that has no audio in the selection;
Only tracks that are visible will be affected.
Also be sure that folders are closed if you don't want the audio within them to be muted,sf.ui.proTools.appActivateMainWindow(); //Ensure Link Track and Edit Selection is enabled sf.ui.proTools.menuClick({ menuPath: ["Options", "Link Track and Edit Selection"], targetValue: "Enable" }); //Get all visible track names const origiVisibleTracks = sf.ui.proTools.visibleTrackNames; //Cycle through each track name and… origiVisibleTracks.forEach(track => { // Select track (which moves edit selection) sf.ui.proTools.trackSelectByName({ names: [track] }); //Check if selected track is an Audio Track and skip if it isn't if (sf.ui.proTools.selectedTrack.title.invalidate().value.endsWith("Audio Track ")) { //Refresh PT menus by activating main window sf.ui.proTools.appActivateMainWindow(); //check if audio is selected by checking if Separate Clip at Transients menu item exists if (sf.ui.proTools.getMenuItem("Edit", "Separate Clip", "At Transients").exists) { //If audio is selected, group audio sf.ui.proTools.getMenuItem("Clip", "Group").elementClick(); //Mute audio sf.ui.proTools.getMenuItem("Edit", "Mute Clips").elementClick(); } } }); log("Finished!", "")
- AAlbert Romero @Albert_Romero
Thanks Chris! This is amazing!
It didn't work at first because video track was at the top of the session. I moved the video to the bottom of the session, ran the script and BOOM! it worked exactly as i wanted. Appreciate your help with this one!
Chris Shaw @Chris_Shaw2023-04-14 16:56:03.527Z
Glad it's working for you.
Sorry about the video track bug.
I didn't test the script with a video track in my session.
It's a simple fix. I just needed to add the following to check if the selected track is a video track.if (sf.ui.proTools.selectedTrack.title.invalidate().value.endsWith("Video Track ")) return;
I've edited the script above to fix this so just copy it again and run it.
//CS//
Chris Shaw @Chris_Shaw2023-04-14 17:07:11.368Z
Actually, It's better just to check if the selected track is an Audio track.
I've refactored the script above (again).
Should be slightly faster.