Linked from:
- Christian Scheuer @chrscheuer2020-04-20 14:49:59.609Z
Hi Sebastian.
Thank you for taking this to the forum :)You can open the Move to New Folder dialog like this:
sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ isRightClick: true, menuPath: ['Move to...', 'New Folder...'] });
- SSebastian @Sebastian
thanks. But there is no Macro for doing this at the moment, right?
- SSebastian @Sebastian
sorry just realised that changing the last value is just what I need. Thanks.
Christian Scheuer @chrscheuer2020-04-20 15:23:18.754Z
Great :) Yes exactly - even if you aren't familiar with scripts, often you can get what you want just by copy/pasting and changing a few things.
- SSebastian @Sebastian
Sorry one more thing. I tried it the first time and it worked fine. Now I tried to copy it again but now it says there is an error in the first line. I see that in my script the popupmenuSelecte is not red anymore. Any idea how to fi it?
Christian Scheuer @chrscheuer2020-04-20 15:35:10.410Z
We'll need to see the actual error. To get the error, either:
- Click SF icon, where there's a small blue dot, click the grey dot to the right of it
- Select "Open Log File"
- Run your code again and copy/paste the full error in here.
Or - perhaps more easily - click this link and follow the instructions:
Please click here to send us the information we need- SSebastian @Sebastian
Your script is working again I think it came because I tried to combine two scripts. Here is the error code and the script I tried to add to yours. I guess its a problem how I combined the two, is it?
20.04.2020 18:40:14.91 [Backend]: Error in line 1:
Could not open popup menu (PopupMenuSelectAction)
Popup menu was not found (OpenPopupMenuFromElementAction)
Popup window was not found after waiting 2000 ms (WaitForPopupMenuAction)<< Command: Drums [user:ck8isagfr0004mr10asts9q2y:ck98onvxf0000pg101rglaj4b]
sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ isRightClick: true, menuPath: ['Move to...', 'Drums'] }); sf.ui.proTools.selectedTrack.trackOutputSelect({ outputPath: ["bus","bus menu 129-256","Drums (Stereo)"], selectForAllSelectedTracks: true, });
- SSebastian @Sebastian
I am not sure if that helps but it seems to work if I swith the two scripts.
- In reply tochrscheuer⬆:NNacho @Nacho_Sotelo
And how can we apply this to all selected tracks?
Christian Scheuer @chrscheuer2020-04-20 18:20:58.205Z
This should do it:
sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ isRightClick: true, isOption: true, isShift: true, menuPath: ['Move to...', 'New Folder...'] });
- NNacho @Nacho_Sotelo
Thank you!
- In reply toNacho_Sotelo⬆:NNacho @Nacho_Sotelo
Right now I'm just doing it llike this
sf.keyboard.modifiers({ isOption: true, isShift: true, }); sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ isRightClick: true, menuPath: ['Move to...', 'BVs All'] });
Is there a better way?
- In reply tochrscheuer⬆:AAndre de Santanna @Andre_de_Santanna
Hello Chritian,
I tried both this script and the one you posted below, to create a new folder from selected tracks and I'm getting this error.
Thanks for your help05.06.2020 14:47:28.90 [Backend]: Error in line 1:
Could not open popup menu (PopupMenuSelectAction)
Popup menu was not found (OpenPopupMenuFromElementAction)
Popup window was not found after waiting 2000 ms (WaitForPopupMenuAction)<< Command: Move To New Folder [user:default:ckb2orp0r0000aj10nj3o9t9m]
Christian Scheuer @chrscheuer2020-06-07 12:16:22.674Z
Hi Andre.
My best bet would be: try to make sure that the first selected track is visible on screen and see if it helps.
- In reply tochrscheuer⬆:Jjunegate @junegate
Hi, I don't know how to "move to..." my selected tracks to, for example, "ITB MixBuss" folder or ">AC" subfolder
I've tried but only "New Folder..." and "Top Level" works. I'm doing something wrong
Christian Scheuer @chrscheuer2021-01-19 19:26:09.189Z
Hi @junegate
Most likely those menu items start with a space (or maybe even 2 spaces). At least it looks that way visually.
Can you quote the exact script you tried?
- Jjunegate @junegate
Like my other issue with input and output menu list, also this script works random
Let's keep it simple. I just create one routing folder called "UNO"this is the script
sf.ui.proTools.selectedTrack.titleButton.popupMenuSelect({ menuPath: ['Move to...','UNO'], isRightClick: true, });
the log is:PopupMenuSelectAction: Could not open popup menu
!! Command Error: move to folder [user:default:ckk499pw50000tu10ou643fn8]:
Could not open popup menu (move to folder: Line 1)
Popup menu was not found
Popup window was not found after waiting 2000 ms<< Command: move to folder [user:default:ckk499pw50000tu10ou643fn8]
Sometimes it works, sometimes it doesn't
- Jjunegate @junegate
Maybe I found the issue.
Searching on the forum i've found your advise to use
sf.ui.proTools.mainWindow.invalidate();
before the scriptI tried and now it works again. Than also the input search menu and the output search menu works again. So the problem is with the SF cache? How can i prevent this?
ThanksChristian Scheuer @chrscheuer2021-01-20 14:25:45.236Z
You already found the solution :) If the issue is cache related, using that line of code to update the cache is the way to solve it.
- In reply tochrscheuer⬆:MMichael Hartung @Michael_Hartung
Hi Christian,
Can you confirm that this script works for a track that is nested inside a folder? I have been trying to make a script that takes a nested track and moves it up to the Top Level. I tried with the script you posted as the solution by changing the "New Folder..." text to say "Top Level" and it fails. Seems like a simple script, but can't seem to make it go. I'll keep looking for the answer though.
- SIn reply toSebastian⬆:Sebastian @Sebastian
Is there a script to move the tracks that went into a specific folder always go to the top of that folder? When there are already tracks in a folder the new ones default to go under the last one.
Christian Scheuer @chrscheuer2020-04-22 10:46:23.654Z
We should look at reordering tracks as a separate issue (because it's a long and quite complicated topic) that is independent of the task of moving something into a folder. We do have some scripts for this that work more or less - if you start a new topic I'll link you to them in that.
- In reply toSebastian⬆:Andrew Scheps @Andrew_Scheps
This script is a bit of a mess, but here's one I made to assign selected tracks to a new routing folder. One important thing is to change the constant defined at the beginning of the scrip to the name of whatever your default output is set to (just the name of the buss, not the full menu path). Read on to find out why. Step by step, here's what it does:
- Asks you for the name of a new routing folder
- Checks to see what output the top-most selected track is assigned to
- Takes all selected tracks and puts them in a Routing folder (with your name)
- If the original output assignment was different from your default it will reassign the output of the new folder to whatever that was to preserver the signal path (unless it's hardware)
// Get Name for New Folder - Keep in mind this will also be the name of the busses used to route the tracks var folderTitle = sf.interaction.popupText({ title: 'Name of New Folder' }).text; // Set up variables to hold original assignments. NOTE this will only check the top-most selected track //Variable to store the current output assignment var originalOutput = sf.ui.proTools.selectedTrack.outputPathButton.value.invalidate().value; sf.ui.proTools.appActivateMainWindow(); // Refresh PTs track list sf.ui.proTools.mainWindow.invalidate(); // Open Move to New Folder dialog and set parameters sf.ui.proTools.menuClick({ menuPath: ["Track", "Move to New Folder..."], }); //Wait for the 'Move to New Folder' dialog to appear and assign it to the folderDlg variable var folderDlg = sf.ui.proTools.dialogWaitForManual({ dialogTitle: 'Move To New Folder' }).dialog; //Get the Children of the Move to New Folder dialog, filter them so we only get the popup buttons, var popupButtons = folderDlg.getElements("AXChildren").filter(function (e) { return e.fullRole == "AXPopUpButton" }); //Assign the buttons coming out of the previous instruction to individual variables var folderType = popupButtons[0]; if (folderType.value.value != 'Routing Folder') folderType.popupMenuSelect({ menuPath: ['Routing Folder'] }); //Now that it's definitely a routing folder we have the other two popup menus available to assign to variables var folderWidth = sf.ui.proTools.windows.whoseTitle.is('Move To New Folder').first.popupButtons.allItems[2]; var timeBase = sf.ui.proTools.windows.whoseTitle.is('Move To New Folder').first.popupButtons.allItems[1]; // Set them accordingly if (folderWidth.value.value != 'Stereo') folderWidth.popupMenuSelect({ menuPath: ['Stereo'] }); if (timeBase.value.value != 'Samples') timeBase.popupMenuSelect({ menuPath: ['Samples'] }); sf.ui.proTools.windows.whoseTitle.is('Move to New Folder').first.checkBoxes.whoseTitle.is('Route Tracks to New Folder').first.checkboxSet({ targetValue: "Enable", }); sf.ui.proTools.windows.whoseTitle.is('Move To New Folder').first.textFields.whoseTitle.is('Track name').first.elementSetTextFieldWithAreaValue({ value: folderTitle, }); // Make it so sf.ui.proTools.windows.whoseTitle.is('Move To New Folder').first.buttons.whoseTitle.is('Create').first.elementClick(); sf.ui.proTools.windows.whoseTitle.is('Move To New Folder').first.elementWaitFor({ waitType: "Disappear", timeout: 2000, }); // Refresh PTs track list sf.ui.proTools.mainWindow.invalidate(); //Reselect the new folder sf.ui.proTools.trackSelectByName({ deselectOthers: true, names: [folderTitle] }); // Folder will automatically be assigned to the session's default output // If the source track's output was different assign it to the original output unless it was hardware if (originalOutput !== "Mix Buss") { sf.ui.proTools.selectedTrack.trackOutputSelect({ outputSelector: items => items.filter(item => item.path[0] === "bus" && item.path.slice(-1)[0] === originalOutput + " (Stereo)")[0], //skipWhenValueIs: 'Mix Buss', selectForAllSelectedTracks: true, }, function (wasHardware) { log( "Original output was Hardware"); }); }
Chris Shaw @Chris_Shaw2020-12-16 22:04:19.327Z
Thanks for this.
- In reply toAndrew_Scheps⬆:GGiuliano Sulzberger @Giuliano_Sulzberger
Hello! This is really good. Altough at the end it does not remap the outputs to the previous destination. It did it once and then never again wich adds further to my confusion..
the problem is this: I'd like to route two snare tracks in to a Routing Folder. The Snare Tracks before were routed into an "Kit 1" Aux. Wich is not assigned to a hardware output.
Output is just called "Main Out" it will just route to that one no matter what. I guess its a little thing but i cant figure it out.
There is maybe one other clue: If the first track (of the ones i want to move to the folder) is a mono track panned to the middle, the Folder Track's Left Pan will be in the middle also. The Right panpot stays untouched. I guess its trying to maintain the wrong attribute? pan instead of output routing?
Sorry for my noobish question! Any Help would be greatly appreciated!giuli
- In reply toAndrew_Scheps⬆:CCooper Babbes @cooper
Thanks for this killer script Andrew. Is it not possible to route the new folder's output to the main hardware outs if that was the first selected track's output? That part of the script kind of stumped me; isn't it just an output name that it's storing and recalling? Can't figure out why hardware outs would cause a problem.
Also, you mentioned we should change a constant at the beginning of the script to the name of our default output. I don't see a constant like that, and it seems like the script is working anyway. Am I missing something?
Andrew Scheps @Andrew_Scheps
Hi @cooper ,
Here's a version that will do hardware outputs as well. I only did that because in my case nothing ever gets routed directly to hardware, so if my source tracks are going to hardware I want to re-route the folder to my default buss. The reference to the default output above was for a different script.
// Get Name for New Folder - Keep in mind this will also be the name of the busses used to route the tracks var folderTitle = sf.interaction.popupText({ title: 'Name of New Folder' }).text; // Set up variables to hold original assignments. NOTE this will only check the top-most selected track //Variable to store the current output assignment var originalOutput = sf.ui.proTools.selectedTrack.outputPathButton.value.invalidate().value; sf.ui.proTools.appActivateMainWindow(); // Refresh PTs track list sf.ui.proTools.mainWindow.invalidate(); // Open Move to New Folder dialog and set parameters sf.ui.proTools.menuClick({ menuPath: ["Track", "Move to New Folder..."], }); //Wait for the 'Move to New Folder' dialog to appear and assign it to the folderDlg variable var folderDlg = sf.ui.proTools.dialogWaitForManual({ dialogTitle: 'Move To New Folder' }).dialog; //Get the Children of the Move to New Folder dialog, filter them so we only get the popup buttons, var popupButtons = folderDlg.getElements("AXChildren").filter(function (e) { return e.fullRole == "AXPopUpButton" }); //Assign the buttons coming out of the previous instruction to individual variables var folderType = popupButtons[0]; if (folderType.value.value != 'Routing Folder') folderType.popupMenuSelect({ menuPath: ['Routing Folder'] }); //Now that it's definitely a routing folder we have the other two popup menus available to assign to variables var folderWidth = sf.ui.proTools.windows.whoseTitle.is('Move To New Folder').first.popupButtons.allItems[2]; var timeBase = sf.ui.proTools.windows.whoseTitle.is('Move To New Folder').first.popupButtons.allItems[1]; // Set them accordingly if (folderWidth.value.value != 'Stereo') folderWidth.popupMenuSelect({ menuPath: ['Stereo'] }); if (timeBase.value.value != 'Samples') timeBase.popupMenuSelect({ menuPath: ['Samples'] }); sf.ui.proTools.windows.whoseTitle.is('Move to New Folder').first.checkBoxes.whoseTitle.is('Route Tracks to New Folder').first.checkboxSet({ targetValue: "Enable", }); sf.ui.proTools.windows.whoseTitle.is('Move To New Folder').first.textFields.whoseTitle.is('Track name').first.elementSetTextFieldWithAreaValue({ value: folderTitle, }); // Make it so sf.ui.proTools.windows.whoseTitle.is('Move To New Folder').first.buttons.whoseTitle.is('Create').first.elementClick(); sf.ui.proTools.windows.whoseTitle.is('Move To New Folder').first.elementWaitFor({ waitType: "Disappear", timeout: 2000, }); // Refresh PTs track list sf.ui.proTools.mainWindow.invalidate(); //Reselect the new folder sf.ui.proTools.trackSelectByName({ deselectOthers: true, names: [folderTitle] }); // Folder will automatically be assigned to the session's default output // If the source track's output was different assign it to the original output if (originalOutput !== "Mix Buss") { sf.ui.proTools.selectedTrack.trackOutputSelect({ outputSelector: items => items.filter(item => item.path.slice(-1)[0].includes(originalOutput))[0], selectForAllSelectedTracks: true, }); }
- CCooper Babbes @cooper
Ahh got it. This works beautifully, thanks a ton for taking the time to modify that!
- In reply toAndrew_Scheps⬆:TThomas Gloor @Thomas_Gloor
Hey @Andrew_Scheps !
Thank you for this great piece of script!
One question, though. Do you know a way of story not only the originalOutput but also the group assignment of the first selected track to then apply it to the folder, and then clear it from the original first selected track?That would be of great help!
Best,
T.
Andrew Scheps @Andrew_Scheps
Hi Thomas, that can be done but it's actually really complicated and not something I have time to do at the moment. Maybe somebody else will chime in!
- TThomas Gloor @Thomas_Gloor
Hey Andrew!
Thank you for answering! I understand. Thank you anyway :)
- In reply toAndrew_Scheps⬆:TThomas Gloor @Thomas_Gloor
Hey Andrew,
I'm trying out your script, but for some weird reason it fails at the point of switching from basic folder to routing folder in the create new folder window.
Any input?
Best
T
- TThomas Gloor @Thomas_Gloor
EDIT: For some reason it worked in another session!
Andrew Scheps @Andrew_Scheps
Let me know if you can find anything reproducible. Thanks!
- TThomas Gloor @Thomas_Gloor
Will do!
I'm still trying to find a way to copy the orignal insert/sends/groups assignments from original track and apply them to the newly created folder.
I found a way using track presets (very much inspired by @Chris_Shaw's "Track Data Utility" package.Basically I have a track preset named "InsSndGrp" and another "NoInsSndGrp".
I store the data in the first one, then recall it on the Folder.
I then use the second one to clear the inserts and sends but unfortunately it doesn't clear the group assignments. Bummer. - In reply toAndrew_Scheps⬆:TThomas Gloor @Thomas_Gloor
Hi @Andrew_Scheps !
I'm fiddling with the script for it to be able to deal with the group issue. I found a way, not super elegant, and I'm afraid, only viable for PAIRS of tracks, but it's doing what I expect it to do. Will have time to finish it later and will post it!
I'm currently trying one thing but for the life of me can't achieve it. I'd like to replace the text field "Name folder" by having the script storing the first selected tracks name in a variable and then recall it with the suffix LR after. I'll post this version when I finally manage to make it work!
Thank you for a great script!
- OIn reply toSebastian⬆:Orlando Ferrer @Orlando_Ferrer
Hello!
I am having intermittent issues with Andrew's script. Sometimes it works, sometimes it doesn't. When having issues it's always on line 33. I can't seem to decipher the issue... any help would be much appreciated...
Thanks!
Christian Scheuer @chrscheuer2020-10-29 14:59:59.846Z
Hi Orlando,
Please open a new thread for this and link to this thread, as this is already marked solved :) That helps us keep track of open issues and makes it easier to not forget to help. We used the "solved/solution" mark to direct resources.
Even better than that - and to provide even more information that will allow Andrew or others to help you - you may want to use the Script Help solution. See here how to do it (step 1):
- OOrlando Ferrer @Orlando_Ferrer
Understood! thank you, Christian