Scripting made easier with umenu

Jul 22, 2011 at 10:34pm

Scripting made easier with umenu

Hello all,
as the title says, I’m trying to build up some custom tools to script objects for me. I want to reduce my most common patching habits down to hotkeyed scripts to streamline all my work.

In particular, I want object creation, scripting names, connections and resizing to happen automatically. I’m setting up a system (probably going to use multiple buckets, sprintfs and umenus) which will recall my most recently used objects, scripting names, sizes, or functions, in order of most recent to first used.

Depending on how advanced I want to go, I might store it in a coll, and set up different modes to retrieve the data depending on what I’m doing (most recent objects, least used, most used, objects typically used together).

umenus are always really helpful, I’ve set up a few to retrieve the object libraries from the max files (max externals/msp externals)…but they all have the .mxe tag at the end. I realize that I could just go in and delete that bit of text from each entry in the umenu, but I’m trying to get out of the habit of quick and dirty fixes. Is there any way I can format the text so that the filetype is removed? I had thought deselecting ‘show dot files’ would do it, but apparently not.

I’ll very likely be applying the same fix to a whole bunch of other ideas, so any help would be very much appreciated.


Jul 23, 2011 at 12:25pm

this seems to be a task for the regular expressions. does this is what you are looking for? :

– Pasted Max Patch, click to expand. –


Jul 23, 2011 at 3:48pm

It does, thanks Jan! I still have a lot of cooking to do, but I’ll be sure to post up some scripty goodness when I’m done.

Jul 23, 2011 at 5:52pm

Don’t forget to escape your literal full stop before the file extension: [regexp ([\w.]+)\.(mxe)]

Jul 23, 2011 at 11:37pm

oh yes, that’s right – overlooked it.

Jul 28, 2011 at 5:33am

I’ve been switching back and forth between different projects a lot, still working on the scripting stuff. Basically I want to program a window of tools that I can use as a ‘metapatcher’. For my commonly modified attributes (size, scripting name, color, position on screen) I’d like to bypass the inspector. This is one such mechanism… click on any of the panels, hover reports it’s scripting name, you can then use the swatch to change it’s colour.

Only problem is it doesn’t seem to work when the patcher is locked. Ideally I’d like to turn this patcher into a runtime app, so my bandmates will be able to customize their own screensets of other patchers I’ve made, so the scripting is a limited means of patching on the fly even in runtime. I figure it’ll be most useful for dynamically repatching modular synth style bpatchers, but it needs this mechanism to run.

Anyone know why it freezes up? Thanks.

– Pasted Max Patch, click to expand. –

Edit: forgot to include the patch :S

Jul 29, 2011 at 1:05am

from hover help file:

“The hover object does not output anything when the mouse is over objects that do not respond to mouse clicks. This includes the panel and comment objects as well as any object whose Ignore Click attribute is set. In addition, the hover object uses the front-to-back ordering of objects in a patcher to determine the top-most object under the mouse.”


You must be logged in to reply to this topic.