maxinterface.json bound to patcher/standalone objects

Daniel P's icon

Is there a way to bind custom menu items defined in maxinterface.json to specific objects in a patcher/standalone?

For example, sending a value to a number box when a menu item is selected.

I know about the menubar object, but would much rather do all the menu customisation in maxinterface.json, for clarity. If it is possible?

bkshepard's icon

I do this all the time. Modify a copy of the maxinterface.json file (be sure to keep a copy of the original). Then, after you build your standalone, replace the maxinterface.json file that is automatically included in your app's Support>interfaces directory with the one you modified.

Daniel P's icon

bkshepard, I am with you. But is it possible to avoid using the menubar object in the patcher? And instead define the actions the menu items should invoke in the maxinterface.json file?

I tried a simple patch, just a message box with a scripting name of "mymessagebox".

Then added the following menu item to maxinterface.json:
{
    "message" : "firsttry",
    "label" : "First Try",
    "target" : "mymessagebox"
},

I hoped that this would make something happen to the message box when I triggered the "First try" menu item, but it didn't.

That is some super naive hacking, but I am hoping for something along those lines to be possible. Just define all the menu actions in the maxinterface.json file, and do away with the menubar object.

Daniel P's icon

Anyone?

If it is impossible, I'll settle for that. Anyone know? I remember reading in an old thread here someone stating that using maxinterface.json you could do away with the [menubar] object completely, but no further explanation.

hodok's icon

+1 to the question