So I've re-added the ability (with different syntax structure than 1st attempt) to return an alternate value from the visible menu item displayed e.g return the hex of the colour selected
and then added my own == concept when you still want to see both the menu name and the value it's going to return. Note the reporter only reports the value inside the brackets.
Think of this as being equivalent of using a variable to hold the hex value - the variable is called red but returns FF000
Instead of user choosing which variable to use for a menu - it scans all global variables and assumes any ending in menu or * can be used as menu descriptors and offers all of them as a combined menu
More playing around
Notable extra features
Adding an & in front of an item gives you a cumulative menu
e.g
You can get a plain text copy of the generated menu (doesn't handle all my options but does the most common ones) that you can then just paste into a standard menu if you won't need to change it dynmaically
A block that lets you specify which menu you like it to return but with the added bonus that you can collapse the variadic input and it will remember the last value specified using a block variable in the reporter
Also, there is a helper block that will produce nested or cumaltive menus from a sequence of lists
is there a way to make a block that takes 3 inputs, the first one is a variable list, the second is an item number from the list, and the third is a menu from that item number of the list.
For example, I make the first input, "list". Then the second input would have a dropdown for every item number in the list. Let's say I put it to 2. Then the third input dropdown would update to the second item of the list as it's dropdown inputs.
It would really help if you can make something like that.
I'm thinking (without trying to code something) that this is going to be a bit awkward (nothing is usually impossible so I won't say that word)
The basic issue is that, at the moment, my JS code can read the displayed contents of another slot.
So slot 2 can determine what slot1 is displaying. But it would be very hard to try and determine the contents of the the list variable that produced the slot 1 output
This is because that Snap isn't actually running when you choose a menu item so it is very difficult to find that information out before the script has run.
What is your end requirement for this as there may be another way to achieve your goal
I only did that block for Brian's benefit so it doesn't contain later code that treats numbers as strings as the other blocks do
And the general answer is that a JS menu produces an object and not simple variables and object keys and values can be string representation of numbers
Also, I'm really bad at JS so the above explanation might be wrong but my other blocks handle number menus fine, so I must have done something right
Edit
e.g this example bit of my code sticks "" at start of concatenation so that JS treats everything as strings and not numbers
I found out another way to do it, and it was also for a mock-up for a program I am going to make. idk why I was trying to make it act exactly how my program is going to be like.