Title
Scroll to selection and plugin open SSL UF1 UC1 Pro Tools
What do you expect to happen when you run the script/macro?
It's supposed to scroll to selected track (Pro Tools), which tells my UF1 to change channel when I select it. Which it is doing fine. But it is also supposed to check the selected channel for SSL Channel Strip and launch the GUI for that plugin, which will tell the UC1 to go to that channel. It was working fine in PT 2024.4 on Sonoma, but I got the SF-1189 issue with the contextual menus. Because I'm currently in the process of switching to PT from a different DAW, I was able to do a fresh install of Ventura on my computer, and roll back PT to 2024.3. My UF1 now goes to the correct channel, but my UC1 doesn't move. The script does appear to be doing something, as the tracks with SSL Native Channel Strip 2 end up moving around the screen (ie. Audio 13 jumps to where Audio 1 was etc).
Are you seeing an error?
What happens when you run this script?
Track selection results in scrolling to selection, but the part where the script is supposed to open the SSL plugin is not working
How were you running this script?
I used a keyboard shortcut within the target app
How important is this issue to you?
5
Details
{ "inputExpected": "It's supposed to scroll to selected track (Pro Tools), which tells my UF1 to change channel when I select it. Which it is doing fine. But it is also supposed to check the selected channel for SSL Channel Strip and launch the GUI for that plugin, which will tell the UC1 to go to that channel. It was working fine in PT 2024.4 on Sonoma, but I got the SF-1189 issue with the contextual menus. Because I'm currently in the process of switching to PT from a different DAW, I was able to do a fresh install of Ventura on my computer, and roll back PT to 2024.3. My UF1 now goes to the correct channel, but my UC1 doesn't move. The script does appear to be doing something, as the tracks with SSL Native Channel Strip 2 end up moving around the screen (ie. Audio 13 jumps to where Audio 1 was etc). ", "inputIsError": false, "inputWhatHappens": "Track selection results in scrolling to selection, but the part where the script is supposed to open the SSL plugin is not working", "inputHowRun": { "key": "-Mpfwh4RkPLb2LPwjePT", "title": "I used a keyboard shortcut within the target app" }, "inputImportance": 5, "inputTitle": "Scroll to selection and plugin open SSL UF1 UC1 Pro Tools" }
Source
var lastFocusedTrackName;
globalState.isFollowFocusedTrackPaused = false;
function main() {
try {
if (globalState.isFollowFocusedTrackPaused) return;
var newName = sf.ui.proTools.selectedTrackNames[0];
if (newName === lastFocusedTrackName || newName === undefined) return;
//This ulitmately makes UF8 follow as well as a work around for banking
const selectedTrackName = sf.ui.proTools.selectedTrackNames[0];
globalState.selectedTracksJT = selectedTrackName;
//log(globalState.selectedTracksJT);
//function scrollToTrack(trackName) {
sf.ui.proTools.appActivateMainWindow();
var originalClipboardText = sf.clipboard.getText().text || '';
sf.ui.proTools.menuClick({ menuPath: ["Track", "Scroll to Track..."] });
sf.ui.proTools.confirmationDialog.elementWaitFor();
sf.clipboard.setText({ text: selectedTrackName });
sf.ui.proTools.menuClick({ menuPath: ['Edit', 'Paste'] });
sf.ui.proTools.confirmationDialog.buttons.whoseTitle.is("OK").first.elementClick();
sf.clipboard.setText({ text: originalClipboardText, });
lastFocusedTrackName = newName;
const pluginName1 = 'SSL Native Channel Strip 2';
const group1Visible = sf.ui.proTools.getMenuItem('View', 'Edit Window Views', 'Inserts A-E').isMenuChecked;
const group2Visible = sf.ui.proTools.getMenuItem('View', 'Edit Window Views', 'Inserts F-J').isMenuChecked;
const insertButtons = sf.ui.proTools.selectedTrack.invalidate().insertButtons.slice(group1Visible ? 0 : 5, group2Visible ? 10 : 5);
const eqButton = insertButtons.find(b => b.exists && b.value.invalidate().value.includes(pluginName));
if (eqButton) {
eqButton.elementClick();
}
} catch (err) {
}
}
function runForever(name, action, interval, timeout) {
var now = (new Date).valueOf();
if (now - globalState[name] < timeout) throw 0; //Exit if we were invoked again inside the timeout
globalState[name] = now;
sf.engine.runInBackground(function () {
try {
while (true) {
sf.engine.checkForCancellation();
globalState[name] = (new Date).valueOf();
action();
sf.wait({ intervalMs: interval, executionMode: 'Background' });
}
} finally {
globalState[name] = null;
}
});
}
runForever("OpenPluginFollowTrackSelection", main, 500, 5000);
Links
User UID: i0dn0LsNB2g67fCGbY2wGHitTPu2
Feedback Key: sffeedback:i0dn0LsNB2g67fCGbY2wGHitTPu2:-O1RcdHIDkDIFtbSWSMO
Feedback ZIP: 7b3LJ1uIb0n1HDaH8a6W7P0pLSS1KnzjEPx9gx8aZsf9dEehjVBbpRzJbKI839CNqaVunmDl4lmQn/ieZTzFxvjQiBFybiuXBZkfwOIfoDAg54DETpYNmbzllGJy0irVh5uqFPFCMrqEUFF51vh5RO4uBMQwRJK5xwF63F813kBPcD2WVgJW4VteLT/sjtxuVByESmfzfCMzbjj1FNkCWooN75dcizhOGqol1yLh23zOGUvrptb21qHoC3fFgzUDMpoWuC/BCnobIcjGtx/KfMS4SCJd7Bq6dZXl/s1NBbc6wRaLyd7SU0OWIK8Ka68dvHdInNm3BMIFlNEBHO8fxg==
- DDr Jack @drjack69
Hello? Am I speaking into the void?
Chris Shaw @Chris_Shaw2024-07-15 23:56:21.088Z
There's an error in the code here:
line 44 isconst pluginName1 = 'SSL Native Channel Strip 2';
but line 52 isconst eqButton = insertButtons.find(b => b.exists && b.value.invalidate().value.includes(pluginName));
It's looking forpluginName
which is not defined. It should bepluginName1
You don't have anything in your catch block (it's empty) so you won't get any indication or error message indicating that something is wrong with the code.- DDr Jack @drjack69
Hi Chris, many thanks for taking the time to reply to me. I tried changing it, but I’m still having the same problem. I did a new report so you could see logs etc. Follow up on previous post regarding SSL script for Pro Tools
- In reply toChris_Shaw⬆:DDr Jack @drjack69
Hi Chris. Don’t know whether you saw my reply to you on the other post. I got it working. I had to make the inserts visible on the edit window. Stupid mistake on my part. Thank you for the script, it’s awesome. If I wanted to add the other plugins (SSL 4K E, and SSL 4K B), how would I put it into the code? Many thanks again.
Chris Shaw @Chris_Shaw2024-07-19 19:23:18.706Z
just change the name of the plugin on line 44:
const pluginName1 = 'SSL Native Channel Strip 2';
- DDr Jack @drjack69
Sorry, I meant have it look for either one of the 3. I assume it might mean: const pluginName1 ‘SSL 4K E’ then on a new line const pluginName2 ‘SSL Native Channel Strip 2’ etc etc…. But I’ve tried that, and I think I messed up the second half of it.
Basically, I want it to look for the three possible SSL channel strip plugins (SSL Native Channel Strip 2; SSL 4K E; and SSL 4K B) where your script you did for me looks for just the one, and open the one it finds.
I’m sorry to continue being a pain in your ass.
Chris Shaw @Chris_Shaw2024-07-19 21:21:10.879Z
This should do it:
function scrollToSelectedTrack(selectedTrackName) { sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.menuClick({ menuPath: ["Track", "Scroll to Track..."] }); const confirmationDialogWin = sf.ui.proTools.confirmationDialog; sf.ui.proTools.confirmationDialog.elementWaitFor(); confirmationDialogWin.textFields.first.elementSetTextFieldWithAreaValue({ value: selectedTrackName, useMouseKeyboard: true }); sf.ui.proTools.confirmationDialog.buttons.whoseTitle.is("OK").first.elementClick(); } function isPluginOpen(pluginInsertButton) { const insertNames = "ABCDEFGHIJ"; const insertLetter = pluginInsertButton.title.value.slice(-1); const insertNumber = insertNames.indexOf(insertLetter) const insertSelectorButton = sf.ui.proTools.selectedTrack.insertSelectorButtons[insertNumber]; const isPluginOpen = insertSelectorButton.value.value.includes("open") return (isPluginOpen) } var lastFocusedTrackName; globalState.isFollowFocusedTrackPaused = false; function main() { if (globalState.isFollowFocusedTrackPaused) return; const selectedTrackName = sf.ui.proTools.selectedTrackNames[0]; if (selectedTrackName === lastFocusedTrackName || selectedTrackName === undefined) return; scrollToSelectedTrack(selectedTrackName) lastFocusedTrackName = selectedTrackName; const pluginNames = ['SSL Native Channel Strip 2', 'SSL 4K E', 'ESSL 4K BQ3 1-Band']; const areInsertsAeVisible = sf.ui.proTools.getMenuItem('View', 'Edit Window Views', 'Inserts A-E').isMenuChecked; const areInsertsFjVisible = sf.ui.proTools.getMenuItem('View', 'Edit Window Views', 'Inserts F-J').isMenuChecked; const visibleInsertButtons = sf.ui.proTools.selectedTrack.invalidate().insertButtons.slice(areInsertsAeVisible ? 0 : 5, areInsertsFjVisible ? 10 : 5); let openPluginWindow = 0 pluginNames.forEach(name => { const pluginInsertButton = visibleInsertButtons.find(b => b.exists && b.value.invalidate().value.includes(name)); if (pluginInsertButton && !isPluginOpen(pluginInsertButton)) { openPluginWindow++ if (openPluginWindow > 1) { sf.ui.proTools.focusedWindow.buttons.whoseTitle.is("Target button").first.elementClick(); } pluginInsertButton.elementClick(); } }) } function runForever(name, action, interval, timeout) { var now = (new Date).valueOf(); if (now - globalState[name] < timeout) throw 0; //Exit if we were invoked again inside the timeout globalState[name] = now; sf.engine.runInBackground(function () { try { while (true) { sf.engine.checkForCancellation(); globalState[name] = (new Date).valueOf(); action(); sf.wait({ intervalMs: interval, executionMode: 'Background' }); } } finally { globalState[name] = null; } }); } runForever("OpenPluginFollowTrackSelection", main, 500, 5000);
- DDr Jack @drjack69
This is AMAZING!! Thank you very much indeed. You could sell this! There would be loads of people interested. I'm going to try and work out how I can get it to close the plugin window if the next selected track doesn't have a compatible plugin, once it can do that, this script will be perfection for SSL control surface users. Here's the code including all the different SSL plugins that are compatible with the UC1, in case anyone else might want it. Sorry, I don't know if I have formatted correctly. Thanks again!
function scrollToSelectedTrack(selectedTrackName) { sf.ui.proTools.appActivateMainWindow(); sf.ui.proTools.menuClick({ menuPath: ["Track", "Scroll to Track..."] }); const confirmationDialogWin = sf.ui.proTools.confirmationDialog; sf.ui.proTools.confirmationDialog.elementWaitFor(); confirmationDialogWin.textFields.first.elementSetTextFieldWithAreaValue({ value: selectedTrackName, useMouseKeyboard: true }); sf.ui.proTools.confirmationDialog.buttons.whoseTitle.is("OK").first.elementClick(); } function isPluginOpen(pluginInsertButton) { const insertNames = "ABCDEFGHIJ"; const insertLetter = pluginInsertButton.title.value.slice(-1); const insertNumber = insertNames.indexOf(insertLetter) const insertSelectorButton = sf.ui.proTools.selectedTrack.insertSelectorButtons[insertNumber]; const isPluginOpen = insertSelectorButton.value.value.includes("open") return (isPluginOpen) } var lastFocusedTrackName; globalState.isFollowFocusedTrackPaused = false; function main() { if (globalState.isFollowFocusedTrackPaused) return; const selectedTrackName = sf.ui.proTools.selectedTrackNames[0]; if (selectedTrackName === lastFocusedTrackName || selectedTrackName === undefined) return; scrollToSelectedTrack(selectedTrackName) lastFocusedTrackName = selectedTrackName; const pluginNames = ['SSL Native Channel Strip 2', 'SSL 4K E', 'SSL 4K B', 'SSL 360 Link', 'SSL Native Bus Compressor 2']; const areInsertsAeVisible = sf.ui.proTools.getMenuItem('View', 'Edit Window Views', 'Inserts A-E').isMenuChecked; const areInsertsFjVisible = sf.ui.proTools.getMenuItem('View', 'Edit Window Views', 'Inserts F-J').isMenuChecked; const visibleInsertButtons = sf.ui.proTools.selectedTrack.invalidate().insertButtons.slice(areInsertsAeVisible ? 0 : 5, areInsertsFjVisible ? 10 : 5); let openPluginWindow = 0 pluginNames.forEach(name => { const pluginInsertButton = visibleInsertButtons.find(b => b.exists && b.value.invalidate().value.includes(name)); if (pluginInsertButton && !isPluginOpen(pluginInsertButton)) { openPluginWindow++ if (openPluginWindow > 1) { sf.ui.proTools.focusedWindow.buttons.whoseTitle.is("Target button").first.elementClick(); } pluginInsertButton.elementClick(); } }) } function runForever(name, action, interval, timeout) { var now = (new Date).valueOf(); if (now - globalState[name] < timeout) throw 0; //Exit if we were invoked again inside the timeout globalState[name] = now; sf.engine.runInBackground(function () { try { while (true) { sf.engine.checkForCancellation(); globalState[name] = (new Date).valueOf(); action(); sf.wait({ intervalMs: interval, executionMode: 'Background' }); } } finally { globalState[name] = null; } }); } runForever("OpenPluginFollowTrackSelection", main, 500, 5000);
Chris Shaw @Chris_Shaw2024-07-20 18:10:50.993Z
Glad everything is working.
If you have achance you should edit the code above so that it is displayed properly.
Just place three backticks ``` (the key below to the escape key on a US keyboard) as the first and last line of the code.
Here's a video:
How to quote code in the SoundFlow forum.- DDr Jack @drjack69
Sorry Chris. Total noob. I will edit it as soon as I’m at an actual computer rather than the phone.
- In reply toChris_Shaw⬆:DDr Jack @drjack69
Think the edit has worked. Let me know if it hasn’t. Thanks.