Customize the Utilities menu of HandlerMenu tool xtra for Director
As this tool scans all your handlers in the current movie you can simply add a script to your movie to get the scripts handlers into the menu. However, if you have handlers, which you use very often and want them to be persistent in the menu, without the need of adding a script to your currently open movie, the Utilities menu may help.
If you want to add your own built-in handlers, add them to the parentscript "custom_Utilities" and add the handlernames to the behaviorscript "OSCmenu_Utilities" in the first handler, just like the already existing handlers. There are two things to keep in mind:
- the parameters are parsed from the menu string, so add the required parameters to the string, which appears in the menu, just like the other menu items.
- the parentscript is executed from within the scope of the stage movie. So every member and other script you refer to in your Utility handler will be taken from the castlibs of the stage movie rather than from the castlibs of this movie.
If you prefer to use buddyMenu xtra (which is free, but sometimes mixes up the menus) over OSControl xtra (you need a license to use it in authoring) simply replace the OSControl menu member with another member. You can use the member "OSControlReplacement" as replacement.
- Select sprite 2 and 3 in the score window, then select member "OSControlReplacement" in the cast window
- Choose from the menu "Edit -> Exchange Cast Members" (or press Cmd + E).
- Delete the OSControl member "oscontrolMenu" (currently member 6 of castlib 1) afterwards.
From that time on the buddyMenu xtra is used to draw the menu instead of the OSControl xtra. the only difference in the script is in script "OSCmenu_Utilities" and "OSCmenu_Handlers": if sprite(me.spritenum).member.type = #OSmenu then ...
Important note: Since OSControls were discontinued and do not work in D11/mac anymore, I switched back to the buddyMenu xtra as default. So the OSControl menu member is not present in the current version of HandlerMenu. If you want to try OSC over buddyMenu, just do the reverse: add an OSC menu member and exchange the member of the sprite and put it back onto the stage (I moved it offscreen, as it now only is used to hold the script)
