Autofill?

To be specific, I’m looking for a way make some data entry more efficient in a patch, so that while the user is entering some options, Max would assist them by cycling through options.

For example, let’s say there is a umenu with 40 different options, is there a way to set it up so that pressing ‘M’ on the computer keyboard would cycle through all of the options in the umenu that start with ‘M’?

You could work something out using [regexp] certainly, where you put in the key letter you want and Max iterates through the list, grabbing any entry that starts with that letter. Just a couple comparison operators and the [regexp] should be able to do this. getting your brain around regexp in general takes some time but it’s quite powerful, and for simple queries like this it would be straightforward. [sprintf] also comes in handy with stuff like this.

jit.cellblock and [coll] could also be used similarly, if the interface works better for your needs. Sounds like there could be some nice possibilities with such a system, like selecting certain filenames out of a list, or giving various options from a word list.

Thanks for this. I’ll do some exploration with your suggestions. I’ve finally got my brain around [sprintf] though I don’t really understand how it would apply here. I also haven’t yet figured out why to use that vs. [regexp] vs. [combine], but I’m sure it will be clear.

What do you mean when you say comparison operators? Like a numeric thing or are you think of a ZL function of some kind?

sprintf is useful in lots of situations, though maybe not this one. It’s definitely handy with weird text formatting stuff though. For this case, you’ll probably just use regexp.

The "comparison operators" probably was a little unclear… all I meant was using (say) "select m" to find instances of "m" being the first letter of the word, etc. So it’s not like a > or < comparison, it's a select-the-one-you-want. Don't forget the very handy right outlet of select and route, too... sometimes these are more useful than the others, if you want to filter things out.

You can search on here for a regexp tutorial, I know there was one posted awhile back and it was very helpful.

Here’s a javascript which does most of what you want. You need to name your [umenu], then use that name as an argument in the [js] object. Sending a "bang" will re-search the "items" attribute of your [umenu] and sending an integer will look up that ascii value and output the index if it is present in the [umenu], repeated pressing of the same key will cycle through all available indices. Here’s the code and an example patch.