[Closed] MenuMan Add existing Menu
I’m getting a bit lost in Menuman at the moment, I want to add in the old File menu by script as I’m fed up of max constantly losing my UI changes.
I know you can get the old File menu using…
menuMan.findMenu "&File"
But how do I add this to the main toolbar?
mm = menuMan.getMainMenuBar()
try this
m = menuMan.findMenu "&File"
mainMenu = menuMan.getMainMenuBar()
menuItem = menuMan.createSubMenuItem "File" m
mainmenu.addItem menuITem (mainMenu.numItems())
menuman.updateMenuBar()
This works in max2014:
m = menuMan.findMenu "&File"
mainMenu = menuMan.getMainMenuBar()
menuIt = menuMan.createSubMenuItem "&File" m
mainmenu.addItem menuIt 1
I changed menuItem variable to menuIt. Looks like menuItem is now a reserved word.
I put it the first in the mainMenu.
And in max2014 dont need use menuman.updateMenuBar()
Thanks!! That works in 2013 but only if you put the update command in.
Here’s a useful startup script, good for when your UI corrupts (which mine seems to do on a weekly basis) It checks to see if the menu is there, if not, it put it in.
mainMenu = menuMan.getMainMenuBar()
if ((mainmenu.getitem 1).getTitle()) != "&File" do
(
m = menuMan.findMenu "&File"
menuIt = menuMan.createSubMenuItem "File" m
mainmenu.addItem menuIt 1
menuman.updateMenuBar()
)
You are welcome.
I’m glad that worked. I have a similar startup script for my own Menu tools and i didn´t tried it yet in max 2012-2013-2014.
We have a bug!
I update the other post,
we should use
menuIt = menuMan.createSubMenuItem "&File" m
instead of
menuIt = menuMan.createSubMenuItem "File" m