By Mitch Willard @Mitch_Willard
Hi all,
Is there a way to exclude items that are greyed out in a popup menu so that only those that are available will fill the popup search menu?
Specifically trying for this particular code getting the items of all the options in the TC/E section in the preferences window, but only show the available items in the popup search.
let tceToolOptions = sf.ui.proTools.windows.whoseTitle.is("Pro Tools Preferences").first.groups.whoseTitle.is("TC/E").first.popupButtons.first.popupMenuFetchAllItems().menuItems
var selectedTCETool = sf.interaction.popupSearch({
title: 'Please Select Backup to Restore from..',
items: tceToolOptions.reverse().map(x => ({
name: x.names.slice(-1)[0],
})),
columns: [{ name: 'Please Select TC/E Tool..', key: 'name', width: 100 }]
}).item.name
cheers
Linked from:
Raphael Sepulveda @raphaelsepulveda2023-05-28 02:51:54.550Z@Mitch_Willard, you could do it by filtering the menu items like this:
let tceToolOptions = sf.ui.proTools.windows.whoseTitle.is("Pro Tools Preferences").first .groups.whoseTitle.is("TC/E").first .popupButtons.first.popupMenuFetchAllItems().menuItems .filter(mi => mi.element.isEnabled);
Mitch Willard @Mitch_WillardAmazing, thanks @raphaelsepulveda. Figured it would be something like this.
Cheers for the help.