Dynamically populating dropdown input slots

I wrote a menu block back in the days of JavaScript that let users define a menu in a list variable.

It looked up the name of the block and then used that name to read the menu.

Just as I finished developing it - JS was disabled :slight_smile:

So I'm trying to recreate it with the new facilities
Original JS block
devMenu script pic

[edit]I'm thinking there's a much easier way of getting same result - working on it now :slight_smile:

Yep - I just needed to reset my world view and not try and do it the old way :slight_smile:

It's trivial to do with new facility :slight_smile:

yay! 3>

I'm kinda opposed to that idea as well

I'm adding some more details to some of the blocks, and I think set slot [ V] to []::control may be broken at the moment


But alas, it is still in development, so that's to be expected

hmm, can you share what you're trying to do?

Yes, one second though I'm making help menus for all of the blocks I made

I think I discovered another glitch. I accidentally clicked the hat that detects when an input has been clicked, and none of the changes to the blocks I've made after that saves

Also here's the block in question
image

I'm not seeing any code in that pic. Can you just show a script pic of the script that throws the error?

Here's my blocks, all fully equipped with help menus.


* I haven't tested this much but atm I think pressing the backpack dropdown accidentally adds every custom block in the backpack

okay, now please

  1. enable visible stepping, then
  2. open the block editor and
  3. run the script that throws the error

and let me know where exactly inside the menu script it occurs. Tnx!


set slot [block V] to [Deleted script.]::control

okay, thanks!
btw, none of your pics seem to have any code in them, or is it just me / my laptop?

I just noticed this as well, I think this might be a bug with the beta because script pics in prod work fine

so, I don't quite understand what this does, and I don't have time to try to second-guess your design, perhaps you'd like to be a little more communicative? Which text or number are you trying to assign to the contents of an input slot? Can you reproduce it with just that data?

Heres the prod version of the script pics, but you'll have to manually replace the Undefined!::other blocks
backpack script pic

I'm trying to change the scripted input (blocks) to be Deleted script. or Deleted all scripts. after you run the script, but it gives a TypeError. The reason for this is because Snap code in Lisp notation can get quite long

nope, the size of text shouldn't be an issue, and neither should script pics be. Both work fine for me:

Confirming Jens code works for me

@mr_owlssssnap2 Maybe save your project, close browser/clear cache and reload to see if that clears your issue?

And maybe post link to your project?