No internet connection
  1. Home
  2. Macro and Script Help

Sort through table in Dante Controller

By Nathan Salefski @nathansalefski
    2024-03-07 21:32:40.953Z

    Title

    Sort through table in Dante Controller

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

    Load preset into Dante Controller

    Are you seeing an error?

    Cannot read property 'mouseClickElement' of undefined (Helper 3 line 9)

    What happens when you run this script?

    It seems as if SoundFlow cannot recognize the rows of this table i'm trying to filter through. The accessibility tool recognizes it just fine but the SoundFlow pick tool does not.

    How were you running this script?

    I used a Stream Deck button

    How important is this issue to you?

    5

    Details

    {
        "inputExpected": "Load preset into Dante Controller",
        "inputIsError": true,
        "inputError": " Cannot read property 'mouseClickElement' of undefined\n(Helper 3 line 9) ",
        "inputWhatHappens": "It seems as if SoundFlow cannot recognize the rows of this table i'm trying to filter through. The accessibility tool recognizes it just fine but the SoundFlow pick tool does not.",
        "inputHowRun": {
            "key": "-MpfwmPg-2Sb-HxHQAff",
            "title": "I used a Stream Deck button"
        },
        "inputImportance": 5,
        "inputTitle": "Sort through table in Dante Controller"
    }

    Source

    function selectPreset(presetName, rows) {
    
        const targetPresetRow = rows.map(r => ({
            presetName: r.childrenByRole('AXCell').first.value,
        })).filter(g => g.presetName === presetName)[0];
    
        targetPresetRow.mouseClickElement();
    }
    
    function main() {
        let danteController = sf.ui.app("com.audinate.dante.DanteController");
    
        danteController.appActivateMainWindow();
        danteController.mainWindow.invalidate();
    
        danteController.mainWindow.children.whoseRole.is("AXToolbar").first.buttons.whoseDescription.is("Load a Preset").first.elementClick({
            executionMode: "Background"
        });
    
        let openWindow = danteController.getWindowWithTitleStartingWith('Open');
    
        openWindow.elementWaitFor();
    
        let rows = openWindow.invalidate().scrollAreas.first.tables.first.childrenByRole('AXRow');
    
        log(rows)
    
        // selectPreset('44khz Sample Rate DANTE Profile 20231130.xml', rows);
    }
    
    main();
    

    Links

    User UID: EoVu20w2ZRTvmJvgozc57ZXuAhU2

    Feedback Key: sffeedback:EoVu20w2ZRTvmJvgozc57ZXuAhU2:-NsPpHRbaRcGAHN4X1h6

    Feedback ZIP: fkKlCVfpt4c0yPbin2/7rDtME8XoPm45uw/NNPLLbXeqWTmRkgEN1uWjJdaAaVT4mSkMJsMoOI5IGp8f2EhYY0hp0NPvVxc7sCOa4KU4HQAq9r005mcAWLCYLSls3/3M8wFE3nWwKPYcOhDS4HaTGYAQAyOrPltlAofeRAGdkBpvt0ZMPzLuapiNgIaF3XWAYWNRBRXCLb1w6Gw2y/lh91MHOkr7gLRsy7HryoQ0sBLUrtWmhcbHiWb6XVG4jHqa1t1wS3Jz8purquI+kjkKEfnxoifFMC2ecyu8Tmmf1nB4sPncxhOOOaYG9zyIg1vB9k+u/9fedCaKLNJQOFmUHvtuYetzMFdHlDL6+uX+sN4=

    • 4 replies
    1. Nathan Salefski @nathansalefski
        2024-03-07 21:33:23.438Z

        As you can see, the accessibility tool recognizes all of the rows within the table

        1. In reply tonathansalefski:
          Nathan Salefski @nathansalefski
            2024-03-08 14:40:02.066Z

            @Kitch I know you're probably slammed with the new release but if you have any ideas let me know!

            1. Kitch Membery @Kitch2024-03-08 18:28:11.298Z

              Hi @nathansalefski,

              Unfortunately, I don't have or use Dante Controller.

              But you could try mapping the rows, by adding .map(row=>row); to the end of line 24 in your script.

              1. Nathan Salefski @nathansalefski
                  2024-03-08 20:38:39.906Z

                  Thanks man. We are getting somewhere. I applied that and it does show the 'AXRows's. I applied it later in the code to get the 'AXCell's as seen in Line 3.

                  function selectPreset(presetName, rows) {
                  
                      const targetPresetRow = rows.map(r =>
                          r.childrenByRole('AXCell').map(cell => cell)[0]
                      );
                  
                      log(targetPresetRow)
                  
                      // let clickPoint = { x: targetPresetRow.frame.x + (targetPresetRow.frame.w / 4), y: targetPresetRow.frame.y + (targetPresetRow.frame.h / 2) }
                  
                      // sf.mouse.setPosition({
                      //     position: clickPoint,
                      // });
                  
                      // sf.mouse.doubleClick({
                      //     position: clickPoint
                      // });
                  }
                  
                  function main() {
                      let danteController = sf.ui.app("com.audinate.dante.DanteController");
                  
                      danteController.appActivateMainWindow();
                      danteController.mainWindow.invalidate();
                  
                      danteController.mainWindow.children.whoseRole.is("AXToolbar").first.buttons.whoseDescription.is("Load a Preset").first.elementClick({
                          executionMode: "Background"
                      });
                  
                      let openWindow = danteController.getWindowWithTitleStartingWith('Open');
                  
                      openWindow.elementWaitFor();
                  
                      let rows = openWindow.invalidate().scrollAreas.first.tables.first.childrenByRole('AXRow').map(row => row);
                  
                      let presetName = '44khz Sample Rate DANTE Profile 20231130.xml'
                  
                      selectPreset(presetName, rows);
                  }
                  
                  main();
                  
                  If I then try to filter the cells to match the description, I cannot. The value of each cell is 0 and the title of each cell is blank. Any suggestions? Here's how I'm attempting to do that:
                  function selectPreset(presetName, rows) {
                  
                      const targetPresetRow = rows.map(r =>
                          r.childrenByRole('AXCell').map(cell => cell)[0].filter(cell =>
                              cell.whoseDescription.contains(presetName)[0]
                          )
                      );
                  
                      log(targetPresetRow)
                  
                      // let clickPoint = { x: targetPresetRow.frame.x + (targetPresetRow.frame.w / 4), y: targetPresetRow.frame.y + (targetPresetRow.frame.h / 2) }
                  
                      // sf.mouse.setPosition({
                      //     position: clickPoint,
                      // });
                  
                      // sf.mouse.doubleClick({
                      //     position: clickPoint
                      // });
                  }
                  
                  function main() {
                      let danteController = sf.ui.app("com.audinate.dante.DanteController");
                  
                      danteController.appActivateMainWindow();
                      danteController.mainWindow.invalidate();
                  
                      danteController.mainWindow.children.whoseRole.is("AXToolbar").first.buttons.whoseDescription.is("Load a Preset").first.elementClick({
                          executionMode: "Background"
                      });
                  
                      let openWindow = danteController.getWindowWithTitleStartingWith('Open');
                  
                      openWindow.elementWaitFor();
                  
                      let rows = openWindow.invalidate().scrollAreas.first.tables.first.childrenByRole('AXRow').map(row => row);
                  
                      let presetName = '44khz Sample Rate DANTE Profile 20231130.xml'
                  
                      selectPreset(presetName, rows);
                  }
                  
                  main();