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

Selecting first cell in Bus tab of I/O Window causes ProTools to hard crash/exit.

By Forrester Savell @Forrester_Savell
    2024-09-17 04:06:44.152Z

    Title

    Selecting first cell in Bus tab of I/O Window causes ProTools to hard crash/exit.

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

    It should open I/O window, delete existing busses, create default busses, then create busses based on the Stems names inputed into stemNames variable.

    Are you seeing an error?

    Protools crashes when selecting the first cell of the Names column in Bus tab.

    What happens when you run this script?

    Have used Pick to select the first row in Bus tab, so that subsequent created busses appear below that row, displacing default busses.

    This code on line 44 does this and is the same as the code on lines 33.

    How were you running this script?

    I clicked the "Run Script" or "Run Macro" button in SoundFlow

    How important is this issue to you?

    5

    Details

    {
        "inputExpected": "It should open I/O window, delete existing busses, create default busses, then create busses based on the Stems names inputed into stemNames variable.",
        "inputIsError": true,
        "inputError": "Protools crashes when selecting the first cell of the Names column in Bus tab.",
        "inputWhatHappens": "Have used Pick to select the first row in Bus tab, so that subsequent created busses appear below that row, displacing default busses.\n\nThis code on line 44 does this and is the same as the code on lines 33.",
        "inputHowRun": {
            "key": "-MpfwYA4I6GGlXgvp5j1",
            "title": "I clicked the \"Run Script\" or \"Run Macro\" button in SoundFlow"
        },
        "inputImportance": 5,
        "inputTitle": "Selecting first cell in Bus tab of I/O Window causes ProTools to hard crash/exit."
    }

    Source

    
    const stemNames = ['Orch',
        'Synth',
        'TnPrc',
        'Prc',
        'Bass',
        'Lp',
        'Pads',
        'SmlPrc',
        'Choir',
        'Soloists',
        'Extra',
    ]
    
    const stemNumber = stemNames.length
    
    function createBuses(busWidth, busNames) {
        //Open I/O Window
        sf.ui.proTools.menuClick({
            menuPath: ["Setup", "I/O..."],
        });
    
        const ioWin = sf.ui.proTools.windows.whoseTitle.is('I/O Setup').first;
    
        //Select "Bus" Tab
        ioWin.radioButtons.whoseTitle.startsWith('Bus').first.elementClick();
    
        //Wait for Tab ("Active Busses" text is unique to the bus tab)
        ioWin.children.whoseRole.is("AXStaticText").whoseValue.is('Active Busses:').first.elementWaitFor();
    
        //Select All Busses ready for deleting
        ioWin.tables.whoseTitle.is("Bus Setup").first.children.whoseRole.is("AXColumn").whoseTitle.is("Name ").
            first.children.whoseRole.is("AXRow").first.children.whoseRole.is("AXCell").allItems[3].textFields.first.
            mouseClickElement({ isOption: true });
    
        //Clear all Busses
        ioWin.buttons.whoseTitle.is("Delete Path").first.elementClick();
    
        //Load Default Busses used for system outputs
        ioWin.buttons.whoseTitle.is("Default").first.elementClick();
    
        //Select First Row (which will be main output, so subsequent busses appear below)
        ioWin.tables.whoseTitle.is("Bus Setup").first.children.whoseRole.is("AXColumn").whoseTitle.is("Name ").
            first.children.whoseRole.is("AXRow").first.children.whoseRole.is("AXCell").allItems[3].textFields.first.elementClick();
    
    
    
        ioWin.buttons.whoseTitle.is("New Path...").first.elementClick();
    
        const newPathWin = sf.ui.proTools.windows.whoseTitle.is("New Paths").first;
    
        for (let i = 0; i < busNames.length; i++) {
            // Select bus width from the popup menu
            newPathWin.popupButtons.allItems[i].popupMenuSelect({
                menuPath: [busWidth]
            });
    
            // Set the bus name
            newPathWin.textFields.whoseValue.is("Bus").first.elementSetTextFieldWithAreaValue({
                value: busNames[i],
            });
    
            // Add a new row if it's not the last item (the "Create" button will add the last row)
            if (i < busNames.length - 1) {
                newPathWin.buttons.whoseTitle.is("Add row").allItems[i].elementClick();
            }
        }
    
        newPathWin.elementWaitFor();
    
        newPathWin.buttons.whoseTitle.is("Create").first.elementClick();
        newPathWin.elementWaitFor({ waitType: "Disappear" });
    
        //ioWin.buttons.whoseTitle.is("OK").first.elementClick();
    
        //ioWin.elementWaitFor({ waitType: "Disappear" });
    
    }
    
    
    function dismissConfirmationDialog(btn) {
        if (sf.ui.proTools.confirmationDialog.invalidate().buttons.whoseTitle.is(btn).first.exists) {
            sf.ui.proTools.confirmationDialog.buttons.whoseTitle.is(btn).first.elementClick();
        }
    };
    
    
    function main() {
        sf.ui.proTools.appActivateMainWindow();
        sf.ui.proTools.invalidate();
    
        var sessionWidth = sf.interaction.displayDialog({
            buttons: ["Stereo", "5.1", "7.1"],
            defaultButton: '5.1',
            prompt: "What format will the session be?",
        }).button;
    
        //sf.ui.proTools.appActivateMainWindow();
        //sf.ui.proTools.mainWindow.invalidate();
    
    
        createBuses(sessionWidth, stemNames)
    }
    main()
    

    Links

    User UID: sKu19XXNXHYSdEMmZtHz8CozbdS2

    Feedback Key: sffeedback:sKu19XXNXHYSdEMmZtHz8CozbdS2:-O6y9JWRz5_9IbNzpSLt

    Feedback ZIP: 667DSQB9g+fnvZAEFHEVgiVBk8qflQBuSUDaIBKC3qOOhjz4somovNmegTga7XII4cCsbH9EhCVrRx/NL22wo9jTDfaWn1ZlOUaPGA+PQ4Xj/eFIY1gCFwIskSDKZpnhedQGC8ltXLSY6rpp1I5WquKD5VeeQJJ/5278p7cJ+4amB4a5OYVyAyiKl34b27thBvoxu279SG3vJ9CulO2f0Pp8wmWsAa+GQdnjVVq1el2tBRnWIBYAxbsqqxzAc8B17Bx3pMTg9vQPnajoXyNTQmwjIaCSoKy6LCY4N7TImpuhs15Wd12vyi8OZpFki8UZOuOMS//5hp2/gcolExSVoD9SRQ1Mek53Nrc7A+5xNEs=

    Solved in post #4, click to view
    • 6 replies
    1. F
      Forrester Savell @Forrester_Savell
        2024-09-17 04:08:03.363Z

        Here is the SF Log error info:

        Error invoking AXElement: kAXErrorCannotComplete (5.1 Film / TV Music Mix Session Prep: Line 44)
        SoundFlow.Shortcuts.AXUIElementException: kAXErrorCannotComplete
        at SoundFlow.Shortcuts.AXUIElement.DoAction(String action) + 0x98
        at SoundFlow.Shortcuts.Automation.Actions.ClickButtonAction.d__11.MoveNext() + 0x7c

        1. Kitch Membery @Kitch2024-09-17 18:38:04.720Z

          Hi @Forrester_Savell,

          I shall take a look at this later today...

          BTW I'll be in Oz, in early October, so I shall schedule an AU SoundFlow Hangout if you're interested. :-)

          1. FForrester Savell @Forrester_Savell
              2024-09-17 23:36:49.765Z

              Super keen mate! Hit me up whenever.

              1. Kitch Membery @Kitch2024-09-17 23:37:25.660Z

                Awesome!!!

            • Kitch Membery @Kitch2024-09-17 22:19:04.137Z

              Hi @Forrester_Savell ,

              Thanks for reporting this, the workaround, for now, would be to use a mouseClickElement().

              sf.ui.proTools.appActivateMainWindow();
              sf.ui.proTools.invalidate();
              
              const ioWin = sf.ui.proTools.windows.whoseTitle.is('I/O Setup').first;
              
              ioWin.radioButtons.whoseTitle.startsWith("Bus ").first.elementClick();
              
              ioWin.tables.whoseTitle.is("Bus Setup").first
                  .children.whoseRole.is("AXColumn").whoseTitle.is("Name ").first
                  .children.whoseRole.is("AXRow").first
                  .children.whoseRole.is("AXCell").allItems[3]
                  .textFields.first.mouseClickElement();
              
              Reply1 LikeSolution
              1. S
                SoundFlow Bot @soundflowbot
                  2024-09-17 22:19:37.274Z

                  This issue is now tracked internally by SoundFlow as SF-1449