No internet connection
  1. Home
  2. Support

Assign Selected Tracks from Eucon Package no longer working?

By Owen Granich-Young @Owen_Granich_Young
    2025-08-18 17:17:24.648Z

    Title

    Assign Selected Tracks from Eucon Package no longer working?

    What do you expect to happen when you run the script/macro?

    Love this script it's not working anymore. Randomly assigns one to the top and then stops.

    Are you seeing an error?

    Could not open popup menu item (Assign Selected Tracks : Line 29) PopupWindow was not found Popup window was not foudn afer waiting 2000 ms

    What happens when you run this script?

    Highlight a selection of tracks, press streamdeck button, it assigns the first one to a random one of the tracks I selected (not the first one) and then ceases to work.

    How were you running this script?

    I used a Stream Deck button

    How important is this issue to you?

    5

    Details

    {
        "inputExpected": "Love this script it's not working anymore. Randomly assigns one to the top and then stops.",
        "inputIsError": true,
        "inputError": "Could not open popup menu item (Assign Selected Tracks : Line 29) PopupWindow was not found Popup window was not foudn afer waiting 2000 ms",
        "inputWhatHappens": "Highlight a selection of tracks, press streamdeck button,  it assigns the first one to a random one of the tracks I selected (not the first one) and then ceases to work.",
        "inputHowRun": {
            "key": "-MpfwmPg-2Sb-HxHQAff",
            "title": "I used a Stream Deck button"
        },
        "inputImportance": 5,
        "inputTitle": "Assign Selected Tracks from Eucon Package no longer working?"
    }

    Source

    
    var eucon = sf.ui.app('com.Euphonix.EuControl');
    eucon.appActivate();
    eucon.getMenuItem("Window", "EuControl Settings").elementClick();
    
    var win = eucon.windows.whoseTitle.is('EuControl Settings').first;
    win.elementWaitFor();
    
    //Switch to Assign tab
    win.tabGroups.first.radioButtons.whoseTitle.is('Assign').first.elementClick();
    win.tabGroups.first.checkBoxes.whoseTitle.is('Display Application\'s Track Numbers').first.elementWaitFor();
    
    //Clear existing assignments
    win.tabGroups.first.buttons.whoseTitle.is('Clear All Assignments').first.elementClick();
    
    //Init
    var table = win.tabGroups.first.scrollAreas.first.tables.first;
    var rows = table.childrenByRole("AXRow").allItems;
    var selectedTrackNames = sf.ui.proTools.selectedTrackNames;
    var nums = Math.min(rows.length, selectedTrackNames.length);
    
    //Assign tracks
    for (var i = 0; i < nums; i++) {
        var row = rows[i];
        var trackName = selectedTrackNames[i];
    
        //Select row
        var cells = row.children.allItems;
        cells[cells.length - 1].popupMenuSelect({
            menuPath: [trackName]
        });
    }
    
    
    //win.windowClose();
    
    

    Links

    User UID: di7dN0keyHdE1HAif7Qi47Oz53E2

    Feedback Key: sffeedback:di7dN0keyHdE1HAif7Qi47Oz53E2:-OXyAsvFhZYorF6pXKCH

    Feedback ZIP: W6w17okG4NQdfcxog5qeJ4/X2jnhpygZCbivhiDYabHNdxr2ZaBvIDIxvkjYAub96CmkakPZPUJKI1D4rSpgc6eJDVR5VOWc66HiISBD66b6fL9TOuVXFyuLGf0ewtS5rWKzPtuAoY7nhJFuGX/Q+rRWYGJErAcTGZi0GWF5t81f9cceUCu79n22sqNZ3MUeuwyN427cqjWD70yZI5joOwP24ZSijVhc+S3JH8xS1HfEuImOWhLLiyiTHYftMojMFPkT1r2WozK3rJ7Lx3715Av7Swmmeg1qq0BE0Z3MDF0Nhn0OIoVOzLlfmkoaObP1W/RPjJ9X4R/wkuhMlQ6T6A==

    Solved in post #2, click to view
    • 3 replies
    1. O

      Sorry to clutter, found this after posting this (should have looked first)
      Assign tracks in eucon no longer assigning all selected tracks #post-13

      Maybe worth updating the package?

      ReplySolution
      1. For my workflow I like my Assigned Faders on the right side of my S3, this one looks at the number of tracks you're assigning. It still assigns left to right (top to bottom) but it does it so the last of the faders you've assigned is the right most fader.

        /**
         * @param {Object} args
         * @param {AxElement} args.popupButton
         * @param {String[]} args.menuPath
         */
        function popupMenuSelectAndWait({ popupButton, menuPath }) {
            // Wait for the Popup Button
            popupButton.elementWaitFor();
        
            // Click the Popu Putton to display and get the Popup Menu
            const popupMenu = popupButton.popupMenuOpenFromElement({
                anchor: "TopLeft", // Required to account for possible menu panel overlaps.
                relativePosition: { x: 5, y: 5 }, // Required to make sure the menu is not being picked from the Popup Button's frame boundaries.
            }).popupMenu;
        
            // Select the Menu Path
            popupMenu.menuClickPopupMenu({ menuPath }, () => {
                sf.ui.frontmostApp.appActivateMainWindow(); // If the menu selection fails, activate the app's main window before throwing an error.
                throw `Failed selecting menu path: ${JSON.stringify(menuPath)}`;
            });
        
            // Wait for the Popup Menu to no-longer have children in turn confirming that the menu has closed.
            sf.waitFor({
                callback: () => !popupMenu.invalidate().children.first.exists,
                timeout: 2000,
            });
        }
        
        if (!sf.ui.proTools.isRunning) throw `Pro Tools is not running`;
        
        sf.ui.proTools.appActivateMainWindow();
        sf.ui.proTools.mainWindow.invalidate();
        
        var eucon = sf.ui.app('com.Euphonix.EuControl');
        eucon.appActivate();
        eucon.getMenuItem("Window", "EuControl Settings").elementClick();
        
        var win = eucon.windows.whoseTitle.is('EuControl Settings').first;
        win.elementWaitFor();
        
        //Switch to Assign tab
        win.tabGroups.first.radioButtons.whoseTitle.is('Assign').first.elementClick();
        win.tabGroups.first.checkBoxes.whoseTitle.is('Display Application\'s Track Numbers').first.elementWaitFor();
        
        //Clear existing assignments
        win.tabGroups.first.buttons.whoseTitle.is('Clear All Assignments').first.elementClick();
        
        // Init
        var table = win.tabGroups.first.scrollAreas.first.tables.first;
        var rows = table.childrenByRole("AXRow").allItems;
        var selectedTrackNames = sf.ui.proTools.selectedTrackNames;
        var numTracks = Math.min(rows.length, selectedTrackNames.length);
        var totalSlots = 16;
        
        // Calculate the starting index for assignment from the bottom
        var startIndex = totalSlots - numTracks;
        
        // Assign tracks (bottom-aligned, using popupMenuSelectAndWait)
        for (var i = 0; i < numTracks; i++) {
            var row = rows[startIndex + i];
            var trackName = selectedTrackNames[i];
        
            popupMenuSelectAndWait({
                popupButton: row.popupButtons.first,
                menuPath: [trackName],
            });
        }
        
        1. I think this is an Mac/OS popup/menu issue.
          It works fine on my Ventura rig.