No internet connection
  1. Home
  2. How to

Bouce Source .isMenuChecked

By Dustin Harris @Dustin_Harris
    2020-10-26 22:54:35.743Z

    I'm working on a script for which I need to know which bounce source is selected, but I'm very new to converting flatMenuItems and I feel like I'm filtering out the data that would tell me which Bounce Source is menuChecked by my .map() function. Any clues? This is what I have so far:

    sf.ui.proTools.appActivateMainWindow();
    
    sf.ui.proTools.getMenuItem('File', 'Bounce to', 'Disk...').elementClick();
    
    var bounceToDiskWindow = sf.ui.proTools.windows.whoseTitle.is('Bounce').first.elementWaitFor({}, 'Could not find Bounce dialog').element;
    
    let bounceSource = bounceToDiskWindow.popupButtons.first.popupMenuFetchAllItems().menuItems;
    
    sf.ui.proTools.appActivateMainWindow();
    
    let availablePaths = bounceSource.map(mi => mi.path.join(' -> '));
    
    alert(availablePaths.join("\n"))
    
    • 5 replies
    1. samuel henriques @samuel_henriques
        2020-10-27 09:48:47.251Z2020-10-27 10:00:40.901Z

        is this it what you are looking for?

        this is for 3 sources,

        var source = sf.ui.proTools.windows.whoseTitle.is('Bounce').first.popupButtons.whoseDescription.is('').first.invalidate().title.value;
        var source2 = sf.ui.proTools.windows.whoseTitle.is('Bounce').first.popupButtons.whoseDescription.is('').allItems[1].invalidate().title.value;
        var source3 = sf.ui.proTools.windows.whoseTitle.is('Bounce').first.popupButtons.whoseDescription.is('').allItems[2].invalidate().title.value;
        
        log(source)
        log(source2)
        log(source3)
        
        1. Dustin Harris @Dustin_Harris
            2020-10-27 14:46:39.555Z

            Hi Samuel, it's unfortunately not what I'm looking for... I'm hoping to get an array of the menu items in the bounce source popup menu, then filter that array for the active item. This is necessary because the button name alone doesn't give all of this info; there can be multiple menu items with the same name.

            Thanks though! :)

          • In reply toDustin_Harris:
            Kitch Membery @Kitch2020-10-27 20:37:38.238Z

            @Dustin_Harris legend!

            sf.ui.proTools.appActivateMainWindow();
            
            sf.ui.proTools.getMenuItem('File', 'Bounce to', 'Disk...').elementClick();
            
            var bounceToDiskWindow = sf.ui.proTools.windows.whoseTitle.is('Bounce').first.elementWaitFor({}, 'Could not find Bounce dialog').element;
            
            let selectedBounceSource = bounceToDiskWindow.popupButtons.first.popupMenuFetchAllItems().menuItems.filter(x=>x.element.isMenuChecked)[0].path;
            
            log(selectedBounceSource);
            
            
            1. Dustin Harris @Dustin_Harris
                2020-10-27 20:48:11.875Z

                MATE! You're the best.

                log(selectedBounceSource.join(' -> '))
                
                1. Kitch Membery @Kitch2020-10-27 20:49:01.400Z

                  :-)