Hello fellow SoundFlowians!
I'm searching for the best way to un-fold and fold folder tracks in the mix window. The included SoundFlow scripts to not seem to work for me. Is this a PT 2020.11 thing? My approach has been to use the select track macro, convert to a script and try and bolt on some folder code from an old post. I had something kind of working, but now it has stopped functioning. Thank you all for helping someone who is not quite up to speed on code writing yet.
- Raphael Sepulveda @raphaelsepulveda2020-11-21 19:03:05.913Z
Hey John,
Yeah, this one is short and sweet. Just replace folderNameGoesHere with the name of the folder!
sf.ui.proTools.trackGetByName({ name: "folderNameGoesHere" }).track.folderTrackSetOpen({ targetValue: 'Toggle', });
John Costello @John_Costello
Hi Raphael!
Do you mean the track name goes there?
Raphael Sepulveda @raphaelsepulveda2020-11-21 19:08:13.266Z
Yup! The name of the folder track you'd like fold/un-fold. For example, if the folder track is called GTRS, then you would do this:
sf.ui.proTools.trackGetByName({ name: "GTRS" }).track.folderTrackSetOpen({ targetValue: 'Toggle', });
John Costello @John_Costello
Heya Raphael!
Thanks for jumping in on this!
When I put in (Exact correct folder track name.) this:
sf.ui.proTools.trackGetByName({ name: "VCAs" }).track.folderTrackSetOpen({ targetValue: 'Toggle', });
I get this error:
Folder Open/Close state didn't update ) VCAs Folder Toggle: Line 1)
Do I need any additional script before or after?
Raphael Sepulveda @raphaelsepulveda2020-11-21 19:47:54.892Z
Mmm.. I tried to replicate that error but couldn't get it. Give the script below a shot:
sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.invalidate().trackGetByName({ name: "VCAs" }).track.folderTrackSetOpen({ targetValue: 'Toggle', });
Let me know if that works, if not, could you take a screenshot of the Edit Window in Pro Tools so I can see how you have it laid out. Maybe I'm missing something there.
John Costello @John_Costello
Yay!
Very brilliant Raphael! That was the solution! I feel like I can breath again! A big part of my workflow is drilling in and out of my monster sized mixes! Who says you can't have your cake and eat it also! Thank you!
Raphael Sepulveda @raphaelsepulveda2020-11-21 20:19:31.241Z
Perfect, glad that did the trick!
- In reply toraphaelsepulveda⬆:MMichael Keeley @Michael_Keeley
Hi Raphael, Thanks for the code. The only way that I was able to get it to work was to create a new Routing folder then it would work for about 5 minutes. After that I get the following error below in the screen shot. Does anyone know what the issue is?
Thanks!!
Raphael Sepulveda @raphaelsepulveda2021-01-29 07:16:35.706Z
Hey Michael! I answered your question over here: Could not click open close folder Line 3 error #post-2
- JIn reply toJohn_Costello⬆:junegate @junegate
Hi guys, there's a way to fold and un-fold all the folder in a project without specify the name ?
John Costello @John_Costello
I am wondering about this as well. The ability to seamlessly navigate a session using folder tracks is very important in large sessions. I wouldn't even mind if a global "Close all folder tracks." to also included nested folder tracks. Love my SoundFlow...
samuel henriques @samuel_henriques
Hello guys,
this is working for me to close all folder tracks, including nested.
Open all is a bit trickier, but I should be able to find a way.function selectAllFolderTracks() { var visibleTracks = sf.ui.proTools.trackGetVisibleTracks().names var firstTrackFound; let foundTracks = []; while (true) { sf.ui.proTools.trackDeselectAll(); for (var i = 0; i < visibleTracks.length; i++) { var trackIsFolder = sf.ui.proTools.trackGetByName({ name: visibleTracks[i] }).track.children.whoseRole.is("AXDisclosureTriangle").whoseTitle.is('Close Folder') if (trackIsFolder.exists) if (trackIsFolder) { if (!firstTrackFound) { // Scroll to first track found sf.ui.proTools.trackGetByName({ name: visibleTracks[i], }).track.trackScrollToView(); firstTrackFound = !firstTrackFound; } else { sf.ui.proTools.trackSelectByName({ names: [visibleTracks[i]], deselectOthers: false }); } foundTracks.push(visibleTracks[i]); } } if (foundTracks.length !== 0) { break; } throw 0; } } function closeFolderTracks() { sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.windows.invalidate(); selectAllFolderTracks() const selectedTracks = sf.ui.proTools.selectedTrackNames.reverse() for (var i = 0; i < selectedTracks.length; i++) { sf.ui.proTools.invalidate().trackGetByName({ name: selectedTracks[i] }).track.folderTrackSetOpen({ targetValue: 'Disable', }); } } closeFolderTracks()
John Costello @John_Costello
Very cool Samuel! Yes I'm opening folder tracks currently by track name, which takes up many StreamDeck buttons. Would love to see an "Open all". Thank you so much for posting this script!!! JC3
PS When I use this it makes me feel like I'm "Cleaning up." my session!
samuel henriques @samuel_henriques
Hey @John_Costello,
Here's a version to open all folder tracks.
Thank you @raphaelsepulveda, lots of code from the close and open folder tracks was taken from other scripts he shared.function selectAllFolderTracks() { var visibleTracks = sf.ui.proTools.trackGetVisibleTracks().names var firstTrackFound; let foundTracks = []; while (true) { sf.ui.proTools.trackDeselectAll(); for (var i = 0; i < visibleTracks.length; i++) { var trackIsFolder = sf.ui.proTools.trackGetByName({ name: visibleTracks[i] }).track.children.whoseRole.is("AXDisclosureTriangle").whoseTitle.is('Open Folder') if (trackIsFolder.exists) if (trackIsFolder) { if (!firstTrackFound) { // Scroll to first track found sf.ui.proTools.trackGetByName({ name: visibleTracks[i], }).track.trackScrollToView(); firstTrackFound = !firstTrackFound; } else { sf.ui.proTools.trackSelectByName({ names: [visibleTracks[i]], deselectOthers: false }); } foundTracks.push(visibleTracks[i]); } } if (foundTracks.length !== 0) { break; } else if (foundTracks.length == 0) { throw 0 } } } function openFolderTracks() { sf.ui.proTools.appActivateMainWindow(); while (true) { selectAllFolderTracks() const selectedTracks = sf.ui.proTools.selectedTrackNames if (selectedTracks.length >= 1) { if (selectedTracks.length == 1) { sf.ui.proTools.selectedTrack.folderTrackSetOpen({ targetValue: 'Enable', onError: 'Continue' }); } if (selectedTracks.length >= 2) { for (var i = 0; i < selectedTracks.length; i++) { sf.ui.proTools.invalidate().trackGetByName({ name: selectedTracks[i] }).track.folderTrackSetOpen({ targetValue: 'Enable', }); } } } } } openFolderTracks()
- Jjunegate @junegate
guys you're amazing!!
I just want to report that both scripts doesn't work if tracks are very little in vertical zoom. There's a way to fix that?samuel henriques @samuel_henriques
Hey @junegate, thank you.
You are right, if the folder icon is not visible, it won't work.
@raphaelsepulveda has a fix for that, I'll try to add it and let you know.
- In reply tosamuel_henriques⬆:
John Costello @John_Costello
Heya Samuel!
Love this!!!!! Thank you!
- In reply tosamuel_henriques⬆:
Joe Costable @Joe_Costable
This works great alone, but I cannot get it to continue on to the rest of my script, and can't figure out why... is it stuck in the loop?
- MIn reply toJohn_Costello⬆:Michael Keeley @Michael_Keeley
Thanks for these great scripts guys!
I was wondering though is it possible to have a script that would select all tracks in the session then do a shift F to toggle the folders open and closed. This way it doesn't matter if the track folders are mini or micro. And it happens a lot faster when you have 20+folders
Thanks so much!
samuel henriques @samuel_henriques
whoww! Thanks for that, never noticed shift+f, 🤯!!
Was trying that exact thing but with code, hahaha!!
here you go:
sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.invalidate(); // Make sure we're on the Edit window. if (!sf.ui.proTools.getMenuItem("Window", "Edit").isMenuChecked) { sf.ui.proTools.menuClick({ menuPath: ["Window", "Edit"], }) }; let folderTracks = sf.ui.proTools.visibleTrackHeaders.filter(x => x.title.value.match("Folder")).map(n => n.title.value.split(" -").slice(0, 1).join()) if (folderTracks.length >= 1) { sf.ui.proTools.trackSelectByName({ names: folderTracks }) sf.keyboard.press({ keys: "shift+f", }); }
Hope this does it!!
samuel henriques @samuel_henriques
Made it select only folder tracks to make it less scary, but it's possible to select all tracks.
samuel henriques @samuel_henriques
Just found this works if you keep all folders and subfolders open. Otherwise the closed subfolder won't be selected and thus open/closed.
- In reply tosamuel_henriques⬆:PPhilip weinrobe @Philip_weinrobe
hi @samuel_henriques
this script above is really really efficient always works great.
however, it only toggles. could this script instead open or close depending on a changed variable?samuel henriques @samuel_henriques
Here you go, let me know if this is it.
/** * @param {"Disable"|"Enable"} targetValue */ function folderTrackSetOpen(targetValue) { sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.invalidate(); // Make sure we're on the Edit window. if (!sf.ui.proTools.getMenuItem("Window", "Edit").isMenuChecked) { sf.ui.proTools.menuClick({ menuPath: ["Window", "Edit"], }) }; let folderTracks = sf.ui.proTools.visibleTrackHeaders.filter(x => x.title.value.endsWith("Folder Track ")) folderTracks.forEach(folder => { folder.folderTrackSetOpen({ targetValue: targetValue }); }) } /// "Disable" to close | "Enable" to open folderTrackSetOpen("Enable")
- PPhilip weinrobe @Philip_weinrobe
perfect!
- MIn reply toJohn_Costello⬆:Michael Keeley @Michael_Keeley
Thanks so much! That works great and is a lot faster!
- CIn reply toJohn_Costello⬆:Cooper Babbes @cooper
Is there a way to do this one-way?
i.e. set the status of a specific folder track to be closed, and do nothing if it's already closed. And even more difficult, do this even if the folder track is Mini or Micro height.
Even more specifically in my case, I want to close and mute a specific folder track, even if it already happens to be either closed or muted, and open and unmute another folder track and all its subtracks, even if it's already open and/or unmuted. (I can do the muting actions with built in actions, not sure about one-way track toggling though.)
samuel henriques @samuel_henriques
Hello @Cooper_Babbes,
This bit controls the script:
/// Set settings here folderSetOpenAndMuteState({ trackName: "Folder Track Name", // Folder track name for action openFolder: "Enable", // Enable or Disable or Toggle to open, close or toggle folder setMute: "Mute" // Mute, Unmute or Toggle Folder track })
Change the parameters to suite your needs and duplicate the this lines for multiple tracks.
It will work if tracks are smaller than small by changing the size.
If you would you like them to go back to the original size, try this first to see if it's what you are looking for, then let me know and I'll add that part.
Let me know how it works.
function setTrackSize(size) { const f = sf.ui.proTools.selectedTrack.frame; const popupMenu = sf.ui.proTools.selectedTrack.popupMenuOpenFromElement({ relativePosition: { x: f.w - 10, y: 5 }, isOption: true, isShift: true, }).popupMenu; popupMenu.menuClickPopupMenu({ menuPath: [size] }); } /** * @param {Object} obj * @param {string} obj.trackName * @param {'Enable'|'Disable'|'Toggle'} obj.openFolder * @param {'Mute'|'Unmute'|'Toggle'|''} obj.setMute */ function folderSetOpenAndMuteState({ trackName, openFolder, setMute }) { const folderTrack = sf.ui.proTools.trackGetByName({ name: trackName }).track const isMuted = folderTrack.muteButton.value.invalidate().value === "on state" // If track size smaller than small, change to small if (folderTrack.frame.h < 43) { folderTrack.trackSelect() folderTrack.trackScrollToView() setTrackSize('small') sf.ui.proTools.invalidate() } // Open or Close folder folderTrack.folderTrackSetOpen({ targetValue: openFolder }); // Mute, Unmute folder if (setMute === "Mute") { if (!isMuted) { folderTrack.muteButton.elementClick() } } else if (setMute === "Unmute") { if (isMuted) { folderTrack.muteButton.elementClick() } } else if (setMute === "Toggle") { folderTrack.muteButton.elementClick() } } /// Set settings here folderSetOpenAndMuteState({ trackName: "Folder Track Name", // Folder track name for action openFolder: "Enable", // Enable or Disable or Toggle to open, close or toggle folder setMute: "Mute" // Mute, Unmute or Toggle Folder track })
- PPhilip weinrobe @Philip_weinrobe
Hi Samuel!
Brilliant script. is there a way we can modify to make it work for ALL FOLDERS in a session?samuel henriques @samuel_henriques
Hello Philip,
Are you looking for this specific actions, or you are looking for a general open/close all folders in a session?- In reply toPhilip_weinrobe⬆:
samuel henriques @samuel_henriques
This is my latest open/close all folders in a session.
normal trigger will close all, add ALT and it will open all
CAN'T have any folder track name using a "-" on the name!!!!
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function closeAllFolderTracks(openFolders) { const folderTracksReverse = openFolders .filter(track => track.title.invalidate().value.endsWith(' Folder Track ') && // This one is not needed, but makes it mutch faster track.children.whoseRole.is("AXDisclosureTriangle").whoseTitle.is("Close Folder").first.exists) .map(folder => folder.normalizedTrackName) .reverse() for (var i = 0; i < folderTracksReverse.length; i++) { sf.ui.proTools.trackGetByName({ name: folderTracksReverse[i] }).track.folderTrackSetOpen({ targetValue: 'Disable', }); }; // Select visible folders sf.ui.proTools.invalidate().trackSelectByName({ names: folderTracksReverse }) }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function ensureOneSelectedTrack() { const firstSelected = sf.ui.proTools.selectedTrackHeaders[0] const viewSelectorPos = sf.ui.proTools.mainWindow.buttons.whoseTitle.is("Edit Window View selector").first.frame.y + 14 const trackListBtnPos = sf.ui.proTools.mainWindow.buttons.whoseTitle.is("Track List Show/Hide").first.frame.y let firstTrackInView = sf.ui.proTools.visibleTrackHeaders.filter(track => track.frame.y > viewSelectorPos && track.frame.y < trackListBtnPos)[0] if (firstSelected) { firstSelected.trackScrollToView() } else { firstTrackInView.trackSelect() firstTrackInView.trackScrollToView() } } const checkFolders = (/** @type {'Close Folder'|'Open Folder'} */ state) => sf.ui.proTools.visibleTrackHeaders.filter(track => track.children.whoseRole.is("AXDisclosureTriangle") .whoseTitle.is(state).first.exists); let failed = [] function openAllFolderTracks() { // Make sure there is one selected track, and header in sight ensureOneSelectedTrack() // Open Folders function open(folderTracks) { if (folderTracks) { folderTracks.forEach(folder => { try { const folderTrack = sf.ui.proTools.trackGetByName({ name: folder }).track if (folderTrack.frame.h < 43) { folderTrack.trackSelect() folderTrack.trackScrollToView() setTrackSize('small') sf.ui.proTools.invalidate() } folderTrack.folderTrackSetOpen({ targetValue: "Enable" }); } catch (err) { try { sf.ui.proTools.trackGetByName({ name: sf.ui.proTools.visibleTrackNames.filter(x => x.includes(folder))[0] }).track.folderTrackSetOpen({ targetValue: "Enable" }); } catch (e) { failed.push(folder) } } }); sf.ui.proTools.invalidate() } }; const [m1, m2, ...folderMenu] = sf.ui.proTools.selectedTrack.popupButtons.first.popupMenuFetchAllItems({ isRightClick: true }) .menuItems.filter(item => item.path[0] === "Move to..." ).map(m => m.path[1]) sf.ui.proTools.appActivateMainWindow() //array for each level let folderArr = [[], [], [], [], [], [], [], []] folderMenu.map(menu => { if (!menu.startsWith(" -")) { folderArr[0].push(menu) } else if (menu.startsWith(" -------")) { folderArr[7].push(menu.split(" -------")[1].trim()) } else if (menu.startsWith(" ------")) { folderArr[6].push(menu.split(" ------")[1].trim()) } else if (menu.startsWith(" -----")) { folderArr[5].push(menu.split(" -----")[1].trim()) } else if (menu.startsWith(" ----")) { folderArr[4].push(menu.split("----")[1].trim()) } else if (menu.startsWith(" ---")) { folderArr[3].push(menu.split(" ---")[1].trim()) } else if (menu.startsWith(" --")) { folderArr[2].push(menu.split(" --")[1].trim()) } else if (menu.startsWith(" -")) { folderArr[1].push(menu.split(" -")[1].trim()) } }) // For each folder parent/level, function open() will receive a array of folders folderArr.forEach(folderTracks => open(folderTracks) ) // Double check if all folders are open let closedFolders = checkFolders("Open Folder") if (closedFolders.length > 0) { open(closedFolders.map(folder => folder.normalizedTrackName)) } // Select visible folders sf.ui.proTools.trackSelectByName({ names: [].concat([], ...folderArr) }) } /** * @param {string} job */ function finishedTheJob(job) { sf.interaction.displayDialog({ prompt: job, giveUpAfterSeconds: 1 }); }; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function setTrackSize(size) { const f = sf.ui.proTools.selectedTrack.frame; const popupMenu = sf.ui.proTools.selectedTrack.popupMenuOpenFromElement({ relativePosition: { x: f.w - 10, y: 5 }, isOption: true, isShift: true, }).popupMenu; popupMenu.menuClickPopupMenu({ menuPath: [size] }); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function main() { const hasAlt = event.keyboardState.hasAlt sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.invalidate(); // Check if Track List is Open const isTrackListOpen = () => sf.ui.proTools.getMenuItem('View', 'Other Displays', 'Track List').isMenuChecked const initialState = isTrackListOpen() // // Open Track List sf.ui.proTools.menuClick({ menuPath: ['View', 'Other Displays', 'Track List'], targetValue: "Enable" }) if (hasAlt) { openAllFolderTracks() if (failed.length > 0) { alert("Could not open folder: \n\n" + failed.join("\n")) } else { finishedTheJob("All Folder Tracks are Open.") } } else { if (checkFolders("Close Folder").length > 0) { closeAllFolderTracks(checkFolders("Close Folder")) } finishedTheJob("All Folder Tracks are Closed.") }; // Set Track List to Initial State if (initialState != isTrackListOpen()) { sf.ui.proTools.menuClick({ menuPath: ['View', 'Other Displays', 'Track List'], targetValue: "Disable" }) }; }; main()
- PPhilip weinrobe @Philip_weinrobe
hmmm, this script is throwing errors for me. says it can't open one of my folders. I don't have any '-' characters.
is it possible to get the other more simple script modified so that it just works on all folders?what i'm trying to do:
have a simple script that can open all top level folders (don't care about sub-folders) with a key command. then i can duplicate that script and change parameters so that it closes all top level folders. both these actions would be regardless of current open/close state of folder.the previous script i replied to did that well, except it was written to have other stuff i didn't need that was getting in the way (track name, mute, etc)
- In reply tosamuel_henriques⬆:
Ben Rubin @Ben_Rubin
Hey @samuel_henriques,
Thanks for the great script! It runs natively on the mix window to close all folders, but it will only open all folders (via the alt modifier) in the edit window. is it possible to make it open all folders natively in the mix window as well?
thanks
ben - In reply tosamuel_henriques⬆:OOwen Granich-Young @Owen_Granich_Young
This was working GREAT for a day and I was using it A LOT, but then all the next day it didn't work. It's giving me this error
11.03.2022 14:47:42.07 [Backend]: !! Command Error: CLOSE ALL FOLDERS SAM [user:ckrzha59p0002b4109dgubkd8:cl0kksdf600004d10ys117ga4]:
Folder Open/Close state didn't update (CLOSE ALL FOLDERS SAM: Line 17Restarted SF and ProTools, no dice. Any thoughts? Of note the session HUUUUUGE.
samuel henriques @samuel_henriques
Hello Owen,
I'm sorry everyone I've been unable to concentrate on the forum for some days but it'll be better soon.
To answer your question, I thing it might happen if the folder tracks size is smaller than small, I think I've come up with a fix for this problem working on another script, but I'll need some time to be able to add it to this script.
Hope this helps.
- OOwen Granich-Young @Owen_Granich_Young
That did the trick thanks!
- In reply tosamuel_henriques⬆:CCooper Babbes @cooper
Sorry for such a late reply here. This works perfectly, thanks a ton for this!
samuel henriques @samuel_henriques
For anyone coming across this, her's my latest open/close all folder tracks.
Much faster and less scripting.///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function closeAllFolderTracks(openFolders) { const folderTracksReverse = openFolders .filter(track => track.title.invalidate().value.endsWith(' Folder Track ') && // This one is not needed, but makes it mutch faster track.children.whoseRole.is("AXDisclosureTriangle").whoseTitle.is("Close Folder").first.exists) .map(folder => folder.normalizedTrackName) .reverse() for (var i = 0; i < folderTracksReverse.length; i++) { sf.ui.proTools.trackGetByName({ name: folderTracksReverse[i] }).track.folderTrackSetOpen({ targetValue: 'Disable', }); }; // Select visible folders //sf.ui.proTools.invalidate().trackSelectByName({ names: folderTracksReverse }) }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function openAll() { sf.ui.proTools.groupsEnsureGroupListIsVisible(); sf.ui.proTools.mainWindow.groupListView.children.whoseRole.is("AXColumn").first .children.whoseRole.is("AXRow").first .children.whoseRole.is("AXCell").first .buttons.first.elementClick(); sf.ui.proTools.trackDeselectAll(); }; function openAllFolderTracks() { sf.ui.proTools.invalidate() const selectedTrackHeaders = sf.ui.proTools.selectedTrackHeaders; openAll(); sf.ui.proTools.invalidate(); // Select original Track Selection if (selectedTrackHeaders.length > 0) { selectedTrackHeaders[0].trackSelect() selectedTrackHeaders[0].trackScrollToView() sf.ui.proTools.trackSelectByName({ names: selectedTrackHeaders.map(tr => tr.normalizedTrackName) }) }; }; /** * @param {string} job */ function finishedTheJob(job) { sf.interaction.displayDialog({ prompt: job, giveUpAfterSeconds: 1 }); }; const checkFolders = (/** @type {'Close Folder'|'Open Folder'} */ state) => sf.ui.proTools.visibleTrackHeaders.filter(track => track.children.whoseRole.is("AXDisclosureTriangle") .whoseTitle.is(state).first.exists); /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// function main() { const hasAlt = event.keyboardState.hasAlt sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.invalidate(); // Check if Track List is Open const isTrackListOpen = () => sf.ui.proTools.getMenuItem('View', 'Other Displays', 'Track List').isMenuChecked const initialState = isTrackListOpen() // // Open Track List sf.ui.proTools.menuClick({ menuPath: ['View', 'Other Displays', 'Track List'], targetValue: "Enable" }) if (hasAlt) { openAllFolderTracks() finishedTheJob("All Folder Tracks are Open.") } else { if (checkFolders("Close Folder").length > 0) { closeAllFolderTracks(checkFolders("Close Folder")) } finishedTheJob("All Folder Tracks are Closed.") }; // Set Track List to Initial State if (initialState != isTrackListOpen()) { sf.ui.proTools.menuClick({ menuPath: ['View', 'Other Displays', 'Track List'], targetValue: "Disable" }) }; }; main()