Hi ,
i don't find a script who allow to select one or many tracks by name.
Otherwise thank's for your script about the track folders. Maybe could you improve it with the posibility to choose the track heights of the "slave" tracks?
Thanks for your feedback.
Jean-Pierre
- Christian Scheuer @chrscheuer2020-04-11 16:52:23.144Z
Hi Jean-Pierre
Thank you for your question.
Selecting either one or many tracks by name can be done in a number of different ways in SoundFlow.
The easiest way is to:
- Create a new Macro by clicking "+ New" and choose "Macro". Give it a name.
- Click "Add Action" and search for "Select Tracks by Name"
You should now see this action:
- Now simply enter the names of the Tracks you want to select and hit Enter.
If you want this as a script, click the "Convert to Script" button:
Christian Scheuer @chrscheuer2020-04-11 16:54:47.780Z
If you just want to select a single track, you can also use the "Select Track" action:
This action has the added benefit that it has a drop down menu where you can choose the specific track you want to select.
- In reply toJean_Pierre_Laforce2⬆:Christian Scheuer @chrscheuer2020-04-11 16:53:48.362Z
Otherwise thank's for your script about the track folders. Maybe could you improve it with the posibility to choose the track heights of the "slave" tracks?
This question is not related to the main question of this thread. We generally try to have one specific issue / purpose / script per thread, otherwise it becomes impossible for people to find information and the forum becomes noisy. Please ask this in the appropriate thread or create a new one.
- JJean-Pierre Laforce @Jean_Pierre_Laforce2
Ok thank's Christian.
Thank's for "select tracks by name" but it dosen't work with "slave tracks" of track folder.
Do you have any explanation?
Thank's in advance.
JpChristian Scheuer @chrscheuer2020-04-12 11:12:26.671Z
Jean-Pierre, I believe this script should work with tracks inside Folders (what you call "slave tracks") if the tracks are already visible.
If you toggle folders open & close them a lot, you may have to use a script where you clear the track cache first, to make sure it's updated://Clear track cache sf.ui.proTools.mainWindow.invalidate(); //Select track "Audio 3" sf.ui.proTools.trackGetByName({ name: "Audio 3", makeVisible: true }).track.trackSelect();
When you're saying it doesn't work, I have the feeling that you're chaining multiple scripts together, since it appears you want to open a Folder track and set the height of the items. Can you try to show us the full script you're using?
- JJean-Pierre Laforce @Jean_Pierre_Laforce2
Thank’s Christian for your feedback,
I just only used the macro « Select tracks by name » and I found that it didn't work on the « slaves » visible tracks. I will asap try your script. Thank’s a lot.
Indeed my goal would be to be able to obtain a scripts who show the « slave » tracks while set up their heights.
Sorry for my awful english.
Thank’s again.
Jp - In reply tochrscheuer⬆:JJean-Pierre Laforce @Jean_Pierre_Laforce2
It's working with that script:
/** * @param {AxPtTrackHeader} track Track to toggle */ function toggleFolderOpen(track) { track.childrenByRole("AXDisclosureTriangle").whoseTitle.contains('Folder').first.elementClick(); } toggleFolderOpen(sf.ui.proTools.trackGetByName({ name: 'Folder 1' }).track); //Clear track cache sf.ui.proTools.mainWindow.invalidate(); sf.ui.proTools.trackSelectByName({ names: ["Audio 1","Audio 2"], }); var size = 'medium'; var f = sf.ui.proTools.selectedTrack.frame; var popupMenu = sf.ui.proTools.selectedTrack.popupMenuOpenFromElement({ relativePosition: { x: f.w - 10, y: 5 }, }).popupMenu; popupMenu.menuClickPopupMenu({ menuPath: [size] });
The only issue is that just once track is resized!
I'm searching a solution. If you have it thank's in advance.
JpChristian Scheuer @chrscheuer2020-04-12 18:11:50.521Z
Hi Jean-Pierre,
Thanks for giving us the full context :)
This script should do what you want. See the
main
function for the sequence in which it calls the other functions./** * @param {AxPtTrackHeader} track Track to toggle */ function toggleFolderOpen(track) { track.childrenByRole("AXDisclosureTriangle").whoseTitle.contains('Folder').first.elementClick(); //Clear track cache sf.ui.proTools.mainWindow.invalidate(); } /** * @param {'small' | 'medium' | 'large'} size */ function setHeightOfSelectedTracks(size) { var f = sf.ui.proTools.selectedTrack.frame; var popupMenu = sf.ui.proTools.selectedTrack.popupMenuOpenFromElement({ relativePosition: { x: f.w - 10, y: 5 }, isOption: true, isShift: true, }).popupMenu; popupMenu.menuClickPopupMenu({ menuPath: [size], }); } function main() { //Toggle folder open toggleFolderOpen(sf.ui.proTools.trackGetByName({ name: 'Folder 1' }).track); //Select tracks sf.ui.proTools.trackSelectByName({ names: ["Audio 1", "Audio 2"], }); //Set height of selected tracks setHeightOfSelectedTracks('medium'); } main();
- JIn reply toJean_Pierre_Laforce2⬆:Jean-Pierre Laforce @Jean_Pierre_Laforce2
Hi Christian,
Thank's a lot it's work perfectly.
Jp