Split Out Repetitive Sfx from an BIG AAF's to their own track.
Alright here is a monotonous task that I would love to try and streamline and optimize with SF.
On certain shows I'll get a a ton of sfx from the picture editor with a bunch of repetitive sfx spread out on different tracks through out the AAF. I used to grab and drag each one to their own track. For ex there would be a Sub_Boom_Hit_12 that I would drag to a track that already had eq's set in my show template for that sound. I since have implented a work flow where I now:
1-find clip Sub_Boom_Hit_12. So that only those sfx show up in the clip window.
2-I select all of the AAF tracks. For ex AAF_1 to AAF_20 in the edit window
3-In the clips bin list I right click Sub_Boom_Hit_12 then select "object select in edit window" I cut out the objects selected at the very first frame of the very first instance of Sub_Boom_Hit_12
4-I then paste the Sub_Boom_Hit_12 sfx on to empty mono files
5-then since they paste separate empty tracks I contol drag to the Stereo Sub_Boom_Hit_12 Track.
It would be a complete game changer for me if there was a way to complete these tasks with a push of a button.
So far I've figured out how to find clips and enter the name Sub_Boom_Hit_12 to show all Sub_Boom_Hit_12 in the clips bin. But not sure the best way to implement steps 2-5.
Is it possible to do this? If so what would be the best way.
Here is the script that I have so far.
Thanks so much!!
Linked from:
- MMichael Keeley @Michael_Keeley
sf.app.launch({
path: "/Applications/Protools.app",
});sf.keyboard.type({
text: "",
});sf.keyboard.press({
keys: "cmd+shift+f",
});sf.keyboard.press({
keys: "shift+s, u, b, shift+minus, shift+b, o, o, m, shift+minus, shift+h, i, t, shift+minus, 1, 2",
});samuel henriques @samuel_henriques
Hello @Michael_Keeley,
Do you have a list of the SFX's names or are the names unknown to you when you are prepping the session?
If so can you share the list?By your description it seams you create a track L and R for each SFX, and then nove them to your work track, did I understood correctly?
- MMichael Keeley @Michael_Keeley
Thanks for the quick reply. I don’t have the exact names yet as they change per show. The sub boom was just an example. Do you think there is a way to create a script that would go through the 5 steps listed.
I would then Duplicate the script and change the file name as needed for ex “air whoosh 1” that is used 15 times through out the show. Then ex Big hit 5 that could be used 34 times.
- MIn reply toMichael_Keeley⬆:Michael Keeley @Michael_Keeley
Also In step 4 I listed it as paste into mono files because there are instances where the sfx are not evenly placed in the original AAF. For ex left could be on track 2 and Right could be on track 3. Instead of left and right always being on ex track 12. 34. 56. Etc etc..
So once they get placed on to the mono tracks. I then move them to 1 stereo track.
Thx!
samuel henriques @samuel_henriques
Hey @Michael_Keeley,
I have to do a similar process when I get AAF's, but don't usually place each sfx name on a separate track. And unfortunately to do this by using the "object select on edit window" is getting a bit tricky, but, I'm still trying.In the mean time, I made one script that will to it clip-by-clip, It's not ideal but at least you can let SoundFlow do it for you.
So first you need to create the tracks for each clip name you want ot move, I assume clip name is relevant until the first "." of the clip name. This will create a L and R track for each with clip name: ex clip name "SFX_1.R.Audio 1_18" will create, SFX_1 L + SFX_1 RAlternatively you find all tracks have only FSX clips that you want to move, you can ditch the "create tracks" script and on the big one replace:
// createTracksAndSelectClip(selectedClipName) // moveToTracks([ // selectedClipName + " L", // selectedClipName + " R", // ]);
with:
createTracksAndSelectClip(selectedClipName) moveToTracks([ selectedClipName + " L", selectedClipName + " R", ]);
This will create the tracks automatically for each clip that doesn't have a corresponding track
So,
Select the clip you want to create tracks for and run this script:
function getClipName() { sf.ui.proTools.menuClick({ menuPath: ["Clip", "Rename..."] }); sf.ui.proTools.windows.whoseTitle.is('Name').first.elementWaitFor({ waitType: "Appear" }); const selectedClipName = sf.ui.proTools.windows.whoseTitle.is('Name').first.groups.whoseTitle.is('Name').first.textFields.first.invalidate().value.value.split(".").slice(0, 1).join("."); sf.ui.proTools.windows.whoseTitle.is('Name').first.buttons.whoseTitle.is('Cancel').first.elementClick(); sf.ui.proTools.windows.whoseTitle.is('Name').first.elementWaitFor({ waitType: "Disappear" }); return selectedClipName } function createTracks() { let selectedClipName = getClipName() sf.ui.proTools.menuClick({ menuPath: ["Track", "New..."] }); const newTrackWin = sf.ui.proTools.windows.whoseTitle.is('New Tracks') newTrackWin.first.buttons.allItems[2].elementClick(); newTrackWin.first.elementWaitFor({ waitType: "Appear" }); newTrackWin.first.textFields.allItems[1].elementSetTextFieldWithAreaValue({ value: selectedClipName + " L" }); newTrackWin.first.textFields.allItems[3].elementSetTextFieldWithAreaValue({ value: selectedClipName + " R" }); newTrackWin.first.buttons.whoseTitle.is('Create').first.elementClick(); newTrackWin.first.elementWaitFor({ waitType: "Disappear" }); } createTracks()
Then you can run the script to move the clips to new tracks, just select all AAF tracks and run the script:
thank you @chrscheuer, for this is an adaptation of his script.function cutButRememberSelection() { sf.ui.proTools.mainCounterDoWithValue({ targetValue: 'Samples', action: () => { //Get original selection var originalSelection = sf.ui.proTools.selectionGetInSamples(); var editCut = sf.ui.proTools.getMenuItem('Edit', 'Cut'); if (!editCut.isEnabled) throw 'No clip selected'; editCut.elementClick({}, 'Could not cut clip'); sf.ui.proTools.selectionSetInSamples({ selectionStart: originalSelection.selectionStart, selectionEnd: originalSelection.selectionEnd, }); } }); } function selectionOverlapsWithExistingClip() { return sf.ui.proTools.getMenuItem("Edit", "Trim Clip", "To Selection").exists; } function moveToTracks(trackNames) { var originalTrackName = sf.ui.proTools.selectedTrackNames[0]; cutButRememberSelection(); var success = false; for (var i = 0; i < trackNames.length; i++) { var trackName = trackNames[i]; sf.ui.proTools.trackSelectByName({ names: [trackName], deselectOthers: true, }); //Update menu sf.keyboard.press({ keys: 'cmd+shift+numpad plus,cmd+shift+numpad minus' }); if (selectionOverlapsWithExistingClip()) continue; var editPaste = sf.ui.proTools.getMenuItem('Edit', 'Paste'); if (!editPaste.isEnabled) throw 'Cannot paste here'; editPaste.elementClick({}, 'Could not paste clip'); success = true; break; } sf.ui.proTools.trackSelectByName({ names: [originalTrackName], deselectOthers: true, }); if (!success) { sf.ui.proTools.getMenuItem('Edit', 'Undo Cut').elementClick(); } } function getClipName() { sf.ui.proTools.menuClick({ menuPath: ["Clip", "Rename..."] }); sf.ui.proTools.windows.whoseTitle.is('Name').first.elementWaitFor({ waitType: "Appear" }); const selectedClipName = sf.ui.proTools.windows.whoseTitle.is('Name').first.groups.whoseTitle.is('Name').first.textFields.first.invalidate().value.value.split(".").slice(0, 1).join("."); sf.ui.proTools.windows.whoseTitle.is('Name').first.buttons.whoseTitle.is('Cancel').first.elementClick(); sf.ui.proTools.windows.whoseTitle.is('Name').first.elementWaitFor({ waitType: "Disappear" }); return selectedClipName } function createTracksAndSelectClip(selectedClipName) { let selectedTrack = sf.ui.proTools.selectedTrackNames let originalSelection = sf.ui.proTools.selectionGetInSamples(); sf.ui.proTools.menuClick({ menuPath: ["Track", "New..."] }); const newTrackWin = sf.ui.proTools.windows.whoseTitle.is('New Tracks') newTrackWin.first.buttons.allItems[2].elementClick(); newTrackWin.first.elementWaitFor({ waitType: "Appear" }); newTrackWin.first.textFields.allItems[1].elementSetTextFieldWithAreaValue({ value: selectedClipName + " L" }); newTrackWin.first.textFields.allItems[3].elementSetTextFieldWithAreaValue({ value: selectedClipName + " R" }); newTrackWin.first.buttons.whoseTitle.is('Create').first.elementClick(); newTrackWin.first.elementWaitFor({ waitType: "Disappear" }); sf.ui.proTools.invalidate(); sf.ui.proTools.trackSelectByName({ names: selectedTrack }) sf.ui.proTools.selectionSetInSamples({ selectionStart: originalSelection.selectionStart, selectionEnd: originalSelection.selectionEnd, }); } function doAdjustment() { let selectedClipName = getClipName() if (sf.ui.proTools.trackGetByName({ name: selectedClipName + " L" }).track !== null && sf.ui.proTools.trackGetByName({ name: selectedClipName + " R" }).track !== null) { moveToTracks([ selectedClipName + " L", selectedClipName + " R", ]); } else { // createTracksAndSelectClip(selectedClipName) // moveToTracks([ // selectedClipName + " L", // selectedClipName + " R", // ]); } } function main() { sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.invalidate(); //Get selected tracks const originalTracks = sf.ui.proTools.selectedTrackNames; //Scroll first selected track to into view sf.ui.proTools.selectedTrack.trackScrollToView(); //Do for each track. sf.ui.proTools.selectedTracks.trackHeaders.slice().map(track => { //Select track track.trackSelect(); //Scroll track into View track.trackScrollToView(); //Run Clip function sf.ui.proTools.clipDoForEachSelectedClip({ action: doAdjustment, onError: "Continue", }); }); //Restore previously selected tracks sf.ui.proTools.trackSelectByName({ names: originalTracks }); } main()
It might take a wile, since he will do the action for every clip.
Or you can do as I do (I haven't found a better/faster way). I use a script that will "object select on edit window" all with same name of the selected clip, and then I'll manually drag them do new tracks.
sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.menuClick({ menuPath: ["View", "Other Displays", "Clip List"], targetValue: "Enable", }); sf.keyboard.press({ keys: "cmd+shift+d", }); ///getRegionName() let currentName = getRegionName() if (currentName.indexOf(".") !== -1){ currentName = currentName.slice(0, currentName.indexOf(".")) } if (currentName.indexOf("-") !== -1){ currentName = currentName.slice(0, currentName.indexOf("-")) } var combinedName = currentName putRegionName() selectClipsInClipList(currentName) function getRegionName() { sf.ui.proTools.menuClick({ menuPath: ['Clip', 'Rename...'] }); sf.ui.proTools.windows.whoseTitle.is('Name').first.elementWaitFor(); var currentRegionName = sf.ui.proTools.windows.whoseTitle.is('Name').first.groups.whoseTitle.is('Name').first.textFields.first.value.value; sf.ui.proTools.windows.whoseTitle.is('Name').first.buttons.whoseTitle.is('Cancel').first.elementClick(); return currentRegionName } function putRegionName() { sf.ui.proTools.appActivateMainWindow(); sf.keyboard.press({ keys: "cmd+shift+f", }); sf.ui.proTools.windows.whoseTitle.is('Find Clips').first.elementWaitFor(); sf.ui.proTools.windows.whoseTitle.is('Find Clips').first.checkBoxes.whoseTitle.is('By name').first.checkboxSet({ targetValue: "Enable", }); sf.ui.proTools.windows.whoseTitle.is('Find Clips').first.textFields.whoseTitle.is('').first.elementSetTextFieldWithAreaValue({ value: combinedName, }); sf.ui.proTools.windows.whoseTitle.is('Find Clips').first.buttons.whoseTitle.is('OK').first.elementClick(); } function selectClipsInClipList(currentName) { sf.ui.proTools.mainWindow.popupButtons.whoseTitle.is('Clip List').first.popupMenuSelect({ menuPath: ["Select", "All"], targetValue: "Enable", }); const row = sf.ui.proTools.mainWindow.clipListView.childrenByRole("AXRow").first; row.children.allItems[1].children.first.popupMenuSelect({ isRightClick: true, menuPath: ['Object Select in Edit Window'], onError: "Continue", }); }
hope it helps, at least as a starter.
samuel henriques @samuel_henriques
sooo....
I've managed to do a new one, this is closer to what you asked and makes more sense, for this one you'll need a list of the clips you want to search for and tracks with same name, to move clips to.
For example, in my test, I had clip name SFX_1 L and R going to tracks SFX_1 L and R and so on.You need to change this portion of the script with the names of clips and tracks to go to without the "L R" portion, the script takes care of that.
You can add as many lines as you need.WARNING: as it stands, in the cases you get the L & R clips from AAF on the annoying middle tracks "L in odd and R on even ". There are cases where they'll be the wrong way on the tracks, L on R and R on L. I couldn't fix it yet.
And I think there could be instanced where he will cut the clip, and paste over a clip that's already on a track, so if you find this is true let me know, and I'll try to find a fix. I the mean time a quick fix is to use "paste" instead of "cut" but then you would have to look at it again to find something out of place.But you need to create tracks as explained above, and/or using the script to create tracks and adding the name to the following portion of the script:
const clipsArray = [ { clip: 'SFX_1', track: 'SFX_1' }, { clip: 'SFX_2', track: 'SFX_2' }, { clip: 'SFX_3', track: 'SFX_3' }, ];
Hope this helps:
const clipsArray = [ { clip: 'SFX_1', track: 'SFX_1' }, { clip: 'SFX_2', track: 'SFX_2' }, { clip: 'SFX_3', track: 'SFX_3' }, ]; function moveToTrack(clip, track, index) { let selectedTracks = sf.ui.proTools.selectedTrackNames let tracksToDeselect = selectedTracks.slice(1) for (var i = 0; i < tracksToDeselect.length; i++) { sf.ui.proTools.mainWindow.groups.whoseTitle.is(tracksToDeselect[i] + ' - Audio Track ').first.popupButtons.first.mouseClickElement({ relativePosition: { "x": 8, "y": 8 }, isCommand: true, }); } sf.ui.proTools.menuClick({ menuPath: ["Edit", "Cut"] }); sf.ui.proTools.menuClick({ menuPath: ["Edit", "Undo Cut"] }); sf.ui.proTools.menuClick({ menuPath: ["Edit", "Cut"] }); if (index % 2 == 0) { sf.ui.proTools.trackSelectByName({ names: [track + " L"] }) } else { sf.ui.proTools.trackSelectByName({ names: [track + " R"] }) } sf.ui.proTools.menuClick({ menuPath: ["Edit", "Paste"] }); } function selectClipsInClipList(clipName) { sf.ui.proTools.mainWindow.popupButtons.whoseTitle.is('Clip List').first.popupMenuSelect({ menuPath: ["Select", "All"], targetValue: "Enable", }); const row = sf.ui.proTools.mainWindow.clipListView.childrenByRole("AXRow").first; if (!row.children.allItems[1].children.first.exists) { clearFindClip(); log(`No clip including the string ${clipName} exists.`); } row.children.allItems[1].children.first.popupMenuSelect({ isRightClick: true, menuPath: ['Object Select in Edit Window'], onError: "Continue", }); } function clipSelect(clipName) { const win = sf.ui.proTools.windows.whoseTitle.is('Find Clips').first; findClip(); win.elementWaitFor({ waitType: "Appear", }); win.checkBoxes.whoseTitle.is('By name').first.checkboxSet({ targetValue: "Enable" }); win.textFields.first.elementSetTextFieldWithAreaValue({ value: clipName, }); win.buttons.whoseTitle.is('OK').first.elementClick(); win.elementWaitFor({ waitType: "Disappear", }); selectClipsInClipList(clipName); } function clearFindClip() { sf.keyboard.press({ keys: "cmd+shift+d", }); } function findClip() { sf.keyboard.press({ keys: "cmd+shift+f", }); } function deselectClip() { sf.keyboard.press({ keys: "down", }); } function doAdjustment(clipsArray) { let { clip, track } = clipsArray; clipSelect(clip); let selectedTracks = sf.ui.proTools.selectedTrackNames for (var i = 0; i < selectedTracks.length; i++) { if (selectedTracks[i].split(" ").slice(0, -1).join(" ") !== track) { clipSelect(clip); moveToTrack(clip, track, i) clearFindClip(); deselectClip(); } else { return } } } function main() { sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.invalidate(); sf.ui.proTools.menuClick({ menuPath: ["View", "Other Displays", "Clip List"], targetValue: "Enable", }); deselectClip(); clearFindClip(); clipsArray.forEach(doAdjustment); var clearfindel = sf.ui.proTools.mainWindow.popupButtons.whoseTitle.is('Clip List').first.popupMenuSelect({ menuPath: ["Clear Find"], }); if (!(clearfindel.exists && clearfindel.isEnabled)) { alert("DONE!") } } main();
- In reply tosamuel_henriques⬆:RRandall Smith @Randall_Smith
I am not the OP, but I think this is a cool script. I am using the second script. I find that, at least for the sound effect libraries that we have internally here that I am getting a number of 'false positives'.
I found that changing the hypens to underscores in this bit of code helped:
if (currentName.indexOf("-") !== -1){
currentName = currentName.slice(0, currentName.indexOf("-"))
}
var combinedName = currentNameAs I no longer getting every ESW or ALIBI effect in a sequence selected, but it isn't perfect. Clips that use underscores instead of spaces are problematic. As an example, selecting ESW_HIT_Hit_For_Hire_01054_13-01, will also select ESW_HIT_Meteor_01374-01, ESW_HIT_One_Hit_Wonder_01066-01, ESW_HIT_Hit_For_Hire_01054_02-01.
I don't want to Hijack the thread, but what can I add to the 'getRegionName' function that would improve this?
Thanks,
Randallsamuel henriques @samuel_henriques
Hey @Randall_Smith,
Happy it's useful for you.If you change the hífen to underscore, he will use only the name untill the first underscore, that's why you get that "false positives". In this case ASW is the name he is searching for.
You can check what he is searching by clicking on find clips after you use the script once. It will show what he looked for.
The idea on this part of code is remove the last parts of names that really don't matter and cause other "false positives".
If you can determine a better rule, I guess it's possible to change the script to work better for you.samuel henriques @samuel_henriques
I have a similar script where I type the name I want to search and select object. Would that be useful for you?
- In reply tosamuel_henriques⬆:RRandall Smith @Randall_Smith
Sam, Thank you for the quick response.
I have been trying with little luck to .split from the back based on hypens and underscores to remove the clip information that editors seem to add.
Randall
samuel henriques @samuel_henriques
When you say you are using the second script, is it the one to select all with same name as selected one?
samuel henriques @samuel_henriques
With your example, I'm not getting any "false positives"
samuel henriques @samuel_henriques
you can use
if (currentName.lastIndexOf("-") !== -1){ currentName = currentName.slice(0, currentName.lastIndexOf("-")) }
to remove the last "-" instead of the first.
so ESW-HIT_One_Hit_Wonder_01066-01 will be different than
ESW_HIT_One_Hit_Wonder_01066-01
- In reply tosamuel_henriques⬆:
Hors Piste @Hors_Piste
Hey @samuel_henriques ! This is the one I dreamed for !!!
It makes the hardest for me !
- MIn reply toMichael_Keeley⬆:Michael Keeley @Michael_Keeley
Wow Speachless!! This is amazing!!! Sam & Christian post pandemic when you are in LA I'm buying drinks. Absolutily incredible and this will save hours and hours of time for sound editors and Mixers!! Thank you!
It works great! Just had one issue, when I crack an AAF I will duplicate all for ex 20 tracks. Then split the duplicates into the session so that I will always have the original material incase the client asks for it.
What I'm noticing is even though I highlight the duplicates only and not the original. It is cutting out the sfx from both. The only way that I seem to see as a work around is hiding the original aaf tracks then it doesn't cut them out from the original AAF audio.
Other than that wow you guys are the Audio Ninja's!!!!
- MMichael Keeley @Michael_Keeley
Also how would I change the script to have it paste in a stereo track instead of 2 mono tracks?
Thx!
samuel henriques @samuel_henriques
Hey @Michael_Keeley,
really cool it works for you! Must thank @Kitch as well, this script is based on something he made for me in the past, and he is in LA, so he'll be the first for drinks, hahaha.
hiding the "original copy" looks like the best thing to do. I usually put them on a folder track and hide it.
Yes it is possible, and they would be moved in pairs witch would be faster, but you would have to go thru the hole aaf to see if there aren't any stereo clips out of the pair alignment. otherwise you would get :
Kitch Membery @Kitch2021-02-02 10:00:12.123Z
The moment we can safely be in the same bar together, I’ll shout the second round of drinks :-)
- In reply tosamuel_henriques⬆:MMichael Keeley @Michael_Keeley
Copy that! Amazing script! Thanks so much Sam, Kitch, and Christian!!
samuel henriques @samuel_henriques
Thank you guys, its been fun...
So I've changed it a bit.
This version will work in pairs of tracks instead of one at a time.
It will prevent moving the clip names witch have clips out of alignment, this:in this case. SFX_1 will go, but SFX3 wont. not just the wrong clip, but all clips will be prevented from moving.
This will give you chance to check on them before something goes wrong.but in this case:
SFX_01 will still be allowed to go since, even if out of alignment, they select an even(4) number of tracks. An odd number of tracks will be prevented from moving.
Of course, the SFX_01 in this case will have some clips where L&R is switched to R&L, but will be put on track. If you think this is stupid, you the only fix for now is use the "one track at a time" version of the script.
(I tried combining both but became to complex)Also, the tracks for clips to move to must be after the tracks you need to move from, if not misbehaviour will occur.
The track/s you are moving clips to must be either in the end of process (no more clips to move to this track) or clean (no clips on track), from my tests clips should be prevented from moving or misbehaviour will occur.
If this script is better, I can change the "create tracks from clip name" to stereo instead of mono L and mono R. For now and to test ,just create stereo tracks with the name of the sfx you want there. Same as before, but remove the L & R from name.
Unfortunately due to my level of knowledge and pro tools idiosyncrasies there must be some rules to use the script.
hope it works for you.
here you go:
const clipsArray = [ { clip: 'SFX_1', track: 'SFX_1' }, { clip: 'SFX_2', track: 'SFX_2' }, { clip: 'SFX_3', track: 'SFX_3' }, ]; function moveToTrack(track) { let selectedTracks = sf.ui.proTools.selectedTrackNames let tracksToDeselect = selectedTracks.slice(2) for (var i = 0; i < tracksToDeselect.length; i++) { sf.ui.proTools.mainWindow.groups.whoseTitle.is(tracksToDeselect[i] + ' - Audio Track ').first.popupButtons.first.mouseClickElement({ relativePosition: { "x": 8, "y": 8 }, isCommand: true, }); } sf.ui.proTools.menuClick({ menuPath: ["Edit", "Cut"] }); sf.ui.proTools.menuClick({ menuPath: ["Edit", "Undo Cut"] }); sf.ui.proTools.menuClick({ menuPath: ["Edit", "Cut"] }); sf.ui.proTools.trackSelectByName({ names: [track] }) sf.ui.proTools.menuClick({ menuPath: ["Edit", "Paste"] }); } function selectClipsInClipList(clipName) { sf.ui.proTools.mainWindow.popupButtons.whoseTitle.is('Clip List').first.popupMenuSelect({ menuPath: ["Select", "All"], targetValue: "Enable", }); const row = sf.ui.proTools.mainWindow.clipListView.childrenByRole("AXRow").first; if (!row.children.allItems[1].children.first.exists) { clearFindClip(); log(`No clip including the string ${clipName} exists.`); } row.children.allItems[1].children.first.popupMenuSelect({ isRightClick: true, menuPath: ['Object Select in Edit Window'], onError: "Continue", }); } function clipSelect(clipName) { const win = sf.ui.proTools.windows.whoseTitle.is('Find Clips').first; findClip(); win.elementWaitFor({ waitType: "Appear", }); win.checkBoxes.whoseTitle.is('By name').first.checkboxSet({ targetValue: "Enable" }); win.textFields.first.elementSetTextFieldWithAreaValue({ value: clipName, }); win.buttons.whoseTitle.is('OK').first.elementClick(); win.elementWaitFor({ waitType: "Disappear", }); selectClipsInClipList(clipName); } function clearFindClip() { sf.keyboard.press({ keys: "cmd+shift+d", }); } function findClip() { sf.keyboard.press({ keys: "cmd+shift+f", }); } function deselectClip() { sf.keyboard.press({ keys: "down", }); } function doAdjustment(clipsArray) { let { clip, track } = clipsArray; clipSelect(clip); let selectedTracks = sf.ui.proTools.selectedTrackNames let loopValue let width if (selectedTracks.length % 2 == 0) { loopValue = selectedTracks.length / 2 } else { log(`${clip} may have clips out of alignment.`) } for (var i = 0; i < loopValue; i++) { if (selectedTracks[i].split(" ").slice(0, -1).join(" ") !== track) { clipSelect(clip); moveToTrack(track) clearFindClip(); deselectClip(); } else { return } } } function main() { sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.invalidate(); sf.ui.proTools.menuClick({ menuPath: ["View", "Other Displays", "Clip List"], targetValue: "Enable", }); deselectClip(); clearFindClip(); clipsArray.forEach(doAdjustment); var clearfindel = sf.ui.proTools.mainWindow.popupButtons.whoseTitle.is('Clip List').first.popupMenuSelect({ menuPath: ["Clear Find"], }); if (!(clearfindel.exists && clearfindel.isEnabled)) { alert("DONE!") } } main();
- MMichael Keeley @Michael_Keeley
Thanks Samuel, the first script you made has been working great if I label the stereo track with an L. The recent script seems to have an error and can't figure out what is going wrong. I removed the L from stereo track names. But keep getting this error that I don't get in your original working script. It says we were called by the stream deck xl but the app is closed and I don't have the xl hooked up?
02.02.2021 17:47:21.61 [Backend]: >> Command: SFX Split Out To Their Own Tracks Sam Revised Stereo [user:ckklhwgdr00009m101xyeo1sq:ckkog5fzl0001dt10mgh8m2ng]
02.02.2021 17:47:21.72 [Backend]: #App: Activate "com.avid.ProTools" -> Protools AS Deck [ck22f20nj00025t10wq6fbk16]
02.02.2021 17:47:21.80 [Backend]: Clicking with mouse here: 70, 28
02.02.2021 17:47:21.83 [Backend]: ProTools version: 20.12.0.190 class: PT2020
ProTools processID: 3673702.02.2021 17:47:22.48 [Backend]: Clicking with mouse here: 3554, 138
02.02.2021 17:47:22.51 [Backend]: PopupMenu full role:AXMenu
02.02.2021 17:47:22.51 [Backend]: Clicking popup menu element: Select
02.02.2021 17:47:22.52 [Backend]: Clicking popup menu element: All
02.02.2021 17:47:22.98 [Backend]: Clicking with mouse here: 3172, 160
02.02.2021 17:47:23.11 [Backend]: PopupMenu full role:AXMenu
02.02.2021 17:47:23.11 [Backend]: Clicking popup menu element: Object Select in Edit Window
02.02.2021 17:47:23.57 [Backend]: [LOG] AP1015 may have clips out of alignment.
02.02.2021 17:47:23.99 [Backend]: Clicking with mouse here: 3554, 138
02.02.2021 17:47:24.02 [Backend]: PopupMenu full role:AXMenu
02.02.2021 17:47:24.02 [Backend]: Clicking popup menu element: Select
02.02.2021 17:47:24.04 [Backend]: Clicking popup menu element: All
02.02.2021 17:47:24.49 [Backend]: Clicking with mouse here: 3172, 160
02.02.2021 17:47:24.61 [Backend]: PopupMenu full role:AXMenu
02.02.2021 17:47:24.61 [Backend]: Clicking popup menu element: Object Select in Edit Window
02.02.2021 17:47:25.01 [Backend]: [LOG] Rolling may have clips out of alignment.
02.02.2021 17:47:25.43 [Backend]: Clicking with mouse here: 3554, 138
02.02.2021 17:47:27.67 [Backend]: Logging error in action (01) WaitForPopupMenuAction: Popup window was not found after waiting 2000 ms
Logging error in action (01) OpenPopupMenuFromElementAction: Popup menu was not found
Logging error in action (01) PopupMenuSelectAction: Could not open popup menu02.02.2021 17:47:27.67 [Backend]: !! Command Error: SFX Split Out To Their Own Tracks Sam Revised Stereo [user:ckklhwgdr00009m101xyeo1sq:ckkog5fzl0001dt10mgh8m2ng]:
Could not open popup menu (SFX Split Out To Their Own Tracks Sam Revised Stereo: Line 39)
Popup menu was not found
Popup window was not found after waiting 2000 ms<< Command: SFX Split Out To Their Own Tracks Sam Revised Stereo [user:ckklhwgdr00009m101xyeo1sq:ckkog5fzl0001dt10mgh8m2ng]
02.02.2021 17:47:27.68 [Backend]: Showing Deck "Protools AS Deck" on Device "Stream Deck XL" (We were called with device "Stream Deck XL")
[StreamDeck] Device 'Stream Deck XL' instantiating deck 'Protools AS Deck'
Logging unknown error in action (02) DeckShowOnStreamDeckDeviceAction: Cannot access a disposed object.
Object name: 'System.Net.Sockets.NetworkStream'.samuel henriques @samuel_henriques
I'm away from the computer now. But, could it be that clip list is not open?
And track name must be the same as clip name
so for clip SFX_1 track name must be SFX_1- MMichael Keeley @Michael_Keeley
Thanks copy yes the clip list was open and names matched the track.
samuel henriques @samuel_henriques
Hey Michael, I think I found the culprit.
I have read about this before, but never had the same problem.
I can replicate the error when the popup button hides under the SoundFlow's logs, if its barely visible, like in the picture, I have no problem.
But if I move the window slightly to the left, the popup will be under the log and fail with the same error as you got.hope this is it