Scripting Macintosh Menus

Menus are very useful for relieving the screen of "button" clutter, to make the project more "Mac"-like, and can also free up score channels. The MM Interactive manual has the details. I typically create a generic menu, and when it needs to be customized to a particular screen, I either replace it with an entirely new menu, or modfiy single menuItems:
  set the enabled of menuItem x of menu 2 to 0  -- greys out this menuItem
The following are used to change the name and script of a menuItem. An Example is when the user selects an Item called "Show Notes" with a script called callShow. This calls a handler that makes a note field appear and then modifies the menu to have an item called "Hide Notes"
on callShow
-- do something to make a field appear

-- update the menu
    set the name of menuItem x of menu 2 to "Hide Notes"
    set the script of menuItem x of menu 2 to callHide
end callShow

on callHide
-- do something to make a field disappear

-- update the menu
    set the name of menuItem x of menu 2 to "Show Notes"
    set the script of menuItem x of menu 2 to callShow
end callHide
Another feature is that if you create an Apple Menu, by designating the menu as:
         menu:@
         MenuItem1 - menuscript1
         MenuItem2 - menuscript2
         ....
In projectors and System 7.x, the user also has access to the appication and balloon menus on the right side of the screen.
This does NOT make the standard Apple menu items available (i.e. Chooser, Control Panels, etc). At this time you cannot access the Finder's Apple menu-- you might be able to re-create them in Lingo...

In debugging and testing, I create a menuItem that when selected, sends an alert with the current frame number. In this way, when I have people testing it an they need to report an error, they can tell me exactly what frame it occurred.

{-- alan  <levine@maricopa.edu>