How to Expand Field Recorder Guide Tracks
When working with EdiLoad and ProTools to create dialogue sessions I need to access the pop up menu for the field recorder guide track work. There are commands for selecting tracks after they are expanded but no command lines that I can string together for expanding the guide tracks.
If I can add a command on my stream deck that’s set up to string together these workflows, I could get the prep work done quicker when I need to access field recorder files for my edit in ProTools.
- Christian Scheuer @chrscheuer2020-04-24 12:44:24.709Z
Hi Candace.
Thank you for bringing your question to the forum :)
Can you help me understand a little more detailed what the exact steps are that you'd like your macro to do?
If you can outline for us step-by-step what the manual actions you'd take were, then it becomes easier to talk about how to automate this via a script.Is this the menu item you want the script to click, or is it something else?
- CCandace Rae Rich @Candace_Rae_Rich
Yes. The pop up menu for the field recorder expand as highlighted in the image is the one I’m attempting to access if possible.
The end goal is a command or set of commands I guess you’d say on my stream deck the first would:
1-selects a set track
2-switches it to a field recorder guide track
3-sets my match criteria to predefined settings as needed
4- launches search window so I can select the source audio root folder for searching.And then another one that would
1-select track (that’s already available) then;
2- expand channels by match criteria (the pop up menu selection your image indicates)Christian Scheuer @chrscheuer2020-04-24 17:39:15.288Z
Great, thank you for the overview & context.
Let's get started with automating the step of clicking "Expand Channels To New Tracks -> By Match Criteria", and once you have that working we can move to the others.sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ isRightClick: true, menuPath: ['Expand Channels To New Tracks', 'By Match Criteria'] });
Dustin Harris @Dustin_Harris
Hi Christian, I'm working on an automated script for this as well. I'll post progress in this thread.
Question: What is the syntax to check a right-click popup menu option? (particularly, I need to know if 'field recorder guide track'.isMenuChecked
make sense?Christian Scheuer @chrscheuer2020-05-01 11:23:13.718Z
Hi Dustin.
This depends on the action you want to take depending on that checked state - do you want to use it to click on the item if it isn't already checked, for example?Dustin Harris @Dustin_Harris
Yeah that is exactly it. If field recorder guide track is not menu checked, then check it. I’m just not sure what the syntax is for right-click popup menus :)
- In reply tochrscheuer⬆:
Dustin Harris @Dustin_Harris
And getting out ahead of this one early, its seems the crux of this script will be having the script wait for the task manager to complete the indexing of the paths specified in the 'Select Areas to Search' menu. Any ninja tricks for that one? :)
Christian Scheuer @chrscheuer2020-05-01 11:24:11.427Z
There may be an icon showing in PT up by the counter when a task is running, but not sure if that's accessible right now.
The "real" way would be to open the task manager window and look for UI element children in the table showing the running tasks.Dustin Harris @Dustin_Harris
That works rather elegantly. (While loop that breaks when task manager children == “”)
- In reply toCandace_Rae_Rich⬆:Dustin Harris @Dustin_Harris
This is working for me (but only if the conform reference tracks aren't already set to 'Field Recorder Guide Track' (I don't know how to check the status of that option yet)
Let me know if it's working for you...//alert(`\ud83d\udce2\ud83d\udc36\ud83c\udde8\ud83c\udde6`); throw 0; //NOTES: This script only works when the tracks do NOT already have Field Recorder Guide Track option Enabled. I'm still trying to figure out the syntax to check that. /* Function Declarations */ //This sets the required checkboxes in the Match Criteria window function setMatchCriteria() { sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ isRightClick: true, menuPath: ['Field Recorder Channels Match Criteria...'] }); var win = sf.ui.proTools.windows.whoseTitle.is('Field Recorder Channels Match Criteria').first.groups.whoseTitle.is('Match Timecode Plus'); win.first.checkBoxes.whoseTitle.is('File Creation Date').first.checkboxSet({ targetValue: "Disable", }); win.first.checkBoxes.whoseTitle.is('Shoot Date').first.checkboxSet({ targetValue: "Disable", }); win.first.checkBoxes.whoseTitle.is('Scene').first.checkboxSet({ targetValue: "Enable", }); win.first.checkBoxes.whoseTitle.is('and Take').first.checkboxSet({ targetValue: "Enable", }); win.first.checkBoxes.whoseTitle.is('Tape Name').first.checkboxSet({ targetValue: "Enable", }); win.first.checkBoxes.whoseTitle.is('Sound Roll Name').first.checkboxSet({ targetValue: "Enable", }); win.first.checkBoxes.whoseTitle.is('Sound Roll Name to Tape Name').first.checkboxSet({ targetValue: "Enable", }); win.first.checkBoxes.whoseTitle.is('Tape Name to Sound Roll Name').first.checkboxSet({ targetValue: "Enable", }); win.first.checkBoxes.whoseTitle.is('First ').first.checkboxSet({ targetValue: "Disable", }); win.first.checkBoxes.whoseTitle.is('Channel Name').first.checkboxSet({ targetValue: "Disable", }); win.first.checkBoxes.whoseTitle.is('Channel Number').first.checkboxSet({ targetValue: "Disable", }); sf.ui.proTools.windows.whoseTitle.is('Field Recorder Channels Match Criteria').first.groups.whoseTitle.is('Name and Sort Tracks by:').first.radioButtons.whoseTitle.is('Channel Number').first.elementClick(); sf.ui.proTools.windows.whoseTitle.is('Field Recorder Channels Match Criteria').first.getElement('AXCloseButton').elementClick(); } //This gets the name of any processes running in the task manager function checkTaskManager() { var taskPending = sf.ui.proTools.windows.whoseTitle.is('Task Manager').first.tables.whoseTitle.is('Active Tasks.').first.children.whoseRole.is("AXColumn").whoseTitle.is('TTextGridView_Column ').first.children.whoseRole.is("AXRow").whoseValue.is('# 0 row Queued. ').first.children.whoseRole.is("AXCell").first.children.whoseRole.is("AXStaticText").first.value.value; return taskPending; } //This waits for the task manager to be finished before continuing with the script function waitForTaskManager() { log('Waiting for folder Synchronization to complete'); if (sf.ui.proTools.getMenuItem('Window', 'Task Manager').isMenuChecked == false) { sf.ui.proTools.menuClick({ menuPath: ["Window", "Task Manager"], }); } var taskPending = checkTaskManager(); while (true) { sf.wait({ intervalMs: 200, }); taskPending = checkTaskManager(); if (taskPending == "") break; //alert(taskPending); } sf.ui.proTools.menuClick({ menuPath: ["Window", "Task Manager"], }); log('Finished Indexing'); } //this selects all tracks by performing option-click on a track function optionClickTrackName() { sf.ui.proTools.mainWindow.groups.allItems[6].popupButtons.first.mouseClickElement({ isOption: true, }); } //This deletes the un-needed tracks created by Ediload ('A0 tracks') function tracksToDelete() { var tracksToSelect = []; let i = 0; var regEx = /Conf_A\d-A0/; var addToTheList = ""; while (i < selectedTracks.length) { addToTheList = selectedTracks[i]; //alert(`${addToTheList} and ${addToTheList.match(regEx)}`); if (addToTheList.match(regEx) !== null) { tracksToSelect.push(addToTheList); } if (i == selectedTracks.length) break; i++; } var track = sf.ui.proTools.trackGetByName({ name: tracksToSelect[0], }).track; track.trackScrollToView(); sf.ui.proTools.trackSelectByName({ deselectOthers: true, names: tracksToSelect }); //track.trackScrollToView(); sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ isRightClick: true, menuPath: ['Delete...'] }); sf.ui.proTools.confirmationDialog.buttons.whoseTitle.is('Delete').first.elementClick(); } //This performs the track expansions function expandTracks() { var i = 0; while (i < allTracks.length) { sf.ui.proTools.trackSelectByName({ deselectOthers: true, names: [allTracks[i]] }); var track = sf.ui.proTools.trackGetByName({ name: allTracks[i], }).track; track.trackScrollToView(); sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ isRightClick: true, menuPath: ['Expand Channels To New Tracks', 'By Match Criteria'] }); log('please wait while tracks expand'); sf.ui.proTools.waitForNoModals(); selectedTracks = sf.ui.proTools.invalidate().selectedTrackNames; tracksToDelete(); if (i == allTracks.length) break; i++ } } /* MAIN CODE */ sf.ui.proTools.appActivateMainWindow(); optionClickTrackName(); var allTracks = sf.ui.proTools.selectedTrackNames; if (allTracks.length == 0) optionClickTrackName(); allTracks = sf.ui.proTools.selectedTrackNames; var selectedTracks = sf.ui.proTools.selectedTrackNames; sf.ui.proTools.trackSelectByName({ deselectOthers: false, names: [allTracks[0]] }); sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ isRightClick: true, menuPath: ['Field Recorder Guide Track'] }); sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ isRightClick: true, menuPath: ['Select Areas to Search...'] }); sf.engine.runInBackground(function () { while (true) { sf.engine.checkForCancellation(); sf.wait({ executionMode: 'Background', intervalMs: 100, onError: 'Continue' }); if (!sf.ui.proTools.windows.invalidate().whoseTitle.is('Select Areas to Search...').exists) break; } }); waitForTaskManager(); setMatchCriteria(); alert('Beginning Expand Tracks.\nThis will take a while and look like it is frozen.\nThis is normal.'); expandTracks(); alert('Conform Finished'); //The End.