Umenu items without file extension

mistabu's icon

Im loading a umenu with presets .json but I do not want to show the .json extension within the umenu items. Any ideas on how to manage it?

Thanks in advance.

Source Audio's icon

regexp filter .json out

regexp .json @substitute % 0

mistabu's icon

Do you mean after "prefix $1" (message)?

Source Audio's icon

Post a patch for better understanding

mistabu's icon

I mean, I load a umenu using "prefix $1"(message) with a specific folder (json presets in that case), umenu dropdown shows the items presetA.json, presetB.json, and so on. But I want to show this items within umenu dropdown without the .json extension as presetA, presetB, and so on..

Source Audio's icon

You will have to use 2 umenus, or folder object linked to umenu,

to filter out .json extension and still be able to recall presets.

There is another probem which you are maybe not aware off:

json is just a plain text file format named so,

if you have any max patch inside that folder or similar file type, it will get listed too.

so you first need to get file type JSON, filter output by extension .json,

add that to list of presets, removing extension at same time.

When you need to recall a preset,

you have to restore full path including extension.

Max Patch
Copy patch and select New From Clipboard in Max.

mistabu's icon

Thanks Source Audio! It worked!