No internet connection
  1. Home
  2. How to

I/O Preset setting Selection

By Mike Avenaim @Mike_Avenaim
    2020-12-23 00:34:33.473Z

    @Kitch Hey man,

    How does this code look? Im essentially wanting it to open a preset I/O setting in case mine get overwritten by another session from a different source. This actually happens frequently to me.

    I havent added the last step of pushing "OK" because im still testing it and dont want to accidentally commit the I/O settings, haha.

    // Activate Pro Tools Window
    sf.ui.proTools.appActivateMainWindow();
    
    // Select I/O Window from Menu
    sf.ui.proTools.menuClick({
        menuPath: ["Setup", "I/O..."],
    });
    
    // Select "Bus" Tab
    sf.ui.proTools.windows.whoseTitle.is('I/O Setup').first.radioButtons.whoseTitle.is('Bus 3 of 6').first.elementClick();
    
    // Import Settings
    sf.ui.proTools.windows.whoseTitle.is('I/O Setup').first.buttons.whoseTitle.is('Import Settings...').first.elementClick();
    
    sf.ui.proTools.windows.whoseTitle.is('I/O Setup').first.elementWaitFor();
    
    // Select desired I/O preset
    sf.keyboard.press({
        keys: "slash",
    });
    sf.keyboard.press({
        keys: "backspace",
    });
    
    //Change name of preset here
    sf.keyboard.type({
        text: "Temp I_O.pio",
    });
    
    sf.keyboard.press({
        keys: "return",
    });
    
    //Open preset
    sf.keyboard.press({
        keys: "return",
    });
    
    sf.ui.proTools.windows.whoseTitle.is('').first.elementWaitFor();
    
    // Delete unused buses prompt
    
    sf.ui.proTools.confirmationDialog.buttons.whoseTitle.is('No').first.elementClick();
    
    Solved in post #3, click to view
    • 4 replies
    1. Kitch Membery @Kitch2020-12-23 00:41:03.157Z

      Nice one Mike!!! I'll take a look :-)

      1. In reply toMike_Avenaim:
        Kitch Membery @Kitch2020-12-23 01:55:55.024Z

        This should do the job mate!

        You got a great start on it!

        Here is an update!

        Be sure to un-comment the ioWin.buttons.whoseTitle.is('OK').first.elementClick(); line to ok the changes.

        And set your preset name in the importBusSettings("Temp I_O.pio"); line.

        function importBusSettings(presetName) {
            //Activate Pro Tools Window
            sf.ui.proTools.appActivateMainWindow();
        
            //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();
        
            //Click 'Import Settings...'
            ioWin.buttons.whoseTitle.is('Import Settings...').first.elementClick();
        
            const openWin = sf.ui.proTools.windows.whoseTitle.is('Open').first;
        
            //Wait for 'Open' window
            openWin.elementWaitFor();
        
            //Open 'go' sheet
            sf.keyboard.type({ text: '/' });
        
            //Wait for Open window
            openWin.sheets.first.elementWaitFor();
        
            //Set preset name
            openWin.sheets.first.comboBoxes.first.value.value = presetName;
        
            //Click Go
            openWin.sheets.first.buttons.whoseTitle.is('Go').first.elementClick();
        
            //Click Open
            openWin.buttons.whoseTitle.is('Open').first.elementClick();
        
            //Wait for Dialog window
            sf.ui.proTools.confirmationDialog.elementWaitFor();
        
            //Delete unused buses prompt
            sf.ui.proTools.confirmationDialog.buttons.whoseTitle.is('No').first.elementClick();
        
            //Click OK
            //ioWin.buttons.whoseTitle.is('OK').first.elementClick();
        }
        
        importBusSettings("Temp I_O.pio");
        
        Reply2 LikesSolution
        1. MMike Avenaim @Mike_Avenaim
            2020-12-23 02:06:17.202Z

            Love this @Kitch really nice way to clean it all up with the function and const

            1. Kitch Membery @Kitch2020-12-23 02:06:40.888Z

              Rock on Brother!