Contractable scripts

Taking into consideration that only useful requests should go here, I came up with something somewhat useful:
[scratchblocks]
bulk script {
repeat (10)
say [Hello!] for (1) secs
} ◂:: grey
bulk script ▸:: grey
[/scratchblocks]

Haha, nice! This was one of the very first features I wrote when I worked on Scratch way back when. The other thing I added was that you could change the label of the C-shaped wrapper, which almost gave you something like a reusable custom block.

But it didn't make it into Scratch back in 2008 :smiley:

oh, huh. didnt know about that. cool, maybe it could be put in snap at some point? technically could be remade with block vars and stuff, but those are extremely finicky and sometimes forget their own value after a reload.

I like this idea! Im going to vote this up...

Very painful implementation i attempted
Uses js
https://snap.berkeley.edu/versions/dev/snap.html#present:Username=jbmc&ProjectName=Bulk%20Scripts

oops that was not supposed to be a reply aaa

I love the idea, but I'm not sure I love the C-block-based interface. I'm thinking that every script should be contractable, on the spur of the moment, hat block and all, and also that if you want to use this feature it's because your scripting area is too crowded, and so throwing in extra C-blocks just exacerbates the problem.

Instead, I would propose adding a Shrink icon (to my astonishment this doesn't seem to be in Unicode, but it's like the arrows Snap! shows in Presentation mode to let you back into Edit mode) to certain blocks:

  • all hat blocks
  • all first blocks of scripts
  • all C-shaped slots, to the left of the slot

When clicked, a Shrink icon causes its associated script to be replaced by a Grow icon

  • in a tiny hat block
  • in a tiny jigsaw block
  • at the end of the text before the C-slot

This sounds really complicated when you lay out all the rules, but I claim it's visually self-explanatory.

Oh, if there's a comment attached to the block with the Shrink icon, and if the text of the comment includes a Shrink icon, everything following that icon is attached to the shrunken script as a comment, in single-line mode. (Does that mode have a name?)

EDIT: Unicode does have candidate Grow icons ⤡ and ⤢, but I can't find Shrink ones.

Maybe ⇱ ⇲ ...

or ↘↖

I also think Unicode should have a standard mechanism to overprint any two characters!

Edit: Don't ask me why the forum software changed your arrows to emoji!

Voted up!

I was actually just going to make a feature request for this, haha. 100% has my vote.

Its got 12 votes.

Maybe This "Contractible Script" thing could be a custom block feature to.

Could someone explain what the original request does? Are bulk scripts like custom blocks, or something else? Thanks!

Its basically a block that enables you to minimize the script, but still be able to run them.

Bump!

Not for 7.0, but we'll think about it after that's finished and out the door.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.