Add and Change Menu Bars Using Scripts

You can use PowerScript to assign and change menu bars in Windows.

Identifying menu items in window scripts

Reference menu items in scripts in windows and controls using this syntax:
menu.menu item

You must always fully qualify the menu item with the name of the menu.

When referring to a menu item in a drop-down or cascading menu, specify each menu item on the path to the menu item you are referencing, using periods to separate the names.

For example, to refer to the Enabled property of menu item m_open, which is under the menu bar item m_file in the menu saved in the library as m_menu, use:
m_menu.m_file.m_open.Enabled

Changing a window's menu at runtime

Use the ChangeMenu function in a script to change the menu associated with a window at runtime.