By samuel henriques @samuel_henriques
hello everyone,
this code will get me the items that are checked from the window menu:
let menuItems = sf.ui.proTools.getMenuItem("Window").popupMenuFetchAllItems().menuItems
let menuEnabled = menuItems.filter(x => x.element.isMenuChecked)
sf.ui.proTools.appActivateMainWindow()
log(menuEnabled)
I'll get the ones with a √, how do I filter the ones with "-"?
In this example, Video and Color Palette?
Thank you so much
Dustin Harris @Dustin_Harris@Kitch came up with this gem:
sf.ui.proTools.appActivateMainWindow(); const menuItems = sf.ui.proTools.getMenuItem('Window').popupMenuFetchAllItems({ dismissMenu: true, }).menuItems; const menuItemsInfo = menuItems.map(mi => ({ path: mi.path, element: mi.element, isSelected: mi.element.isMenuChecked, hasDash: mi.element.getString('AXMenuItemMarkChar') === ('-'), })); let dashedMenuItems = menuItemsInfo.filter(mi => mi.hasDash); log(dashedMenuItems);
samuel henriques @samuel_henriquesright on!! Thank you so much @Dustin_Harris and @Kitch,
this i what i'm working on, It gets the enabled and disabled items from pro tools menus to an array of paths and you can set them back to original state later.