Bouce Source .isMenuChecked
By Dustin Harris @Dustin_Harris
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"))
Linked from:
- samuel henriques @samuel_henriques
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)
Dustin Harris @Dustin_Harris
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);
Dustin Harris @Dustin_Harris
MATE! You're the best.
log(selectedBounceSource.join(' -> '))
Kitch Membery @Kitch2020-10-27 20:49:01.400Z
:-)