There should be start macro and end macro commands. They start the recording of mouse events. The event locations could be relative to the point at which the start macro command was invoked. When the macro is played back, the events should be positioned relative to the point at which the macro call was invoked. The end macro command prompts for a name for the macro. Lets you save it to disk, bind it to mouse events, insert it into a menu. Make menu edit mode, where using different mouse buttons lets you traverse the menus. One button follows a path. If it's a terminal node, you get a node edit menu that lets do things to it. If it's another menu, you recursivly visit it. Making no selections from a visited menu, by mousing up in the menu center, exits the recursive visit. Same method to exit edit menus. You can get a menu edit window by pressing a button while visiting a menu. Add, delete, and edit menu items.