is there a way to dynamically modify the script for a [menubar] object (on MacOS10.6, Max5.1.5)? I’d like to dynamically add/remove menuitems, however, I can’t figure a way to do this. There’s an ‘append’ message for appending to an existing script, but how can I remove things again?
-> alternatively, this could be handled if there would be a way to create the script outside of the menubar object and then simply replace the entire script(s)?
Wondered if anyone figured out a way to do this – I really could use this.
I can "append" an item to a menutitle by passing a message to [menubar]. The documentation, btw, says this is an internal script command, but it works as an external, dynamic message. It also ignores the (required) item number parameter you give it. But there is no way to remove items. If you hit it more than once than it just keeps adding more of the same to the end of the menu.
Interesting, you can "cycle" a toggle for the [menubar] off-then-on-again and when it comes back on, the appended items are cleared. So if you do want a "dynamic" menu you can just re-build it every time you want to alter it…