Snap to snapblocks converter

what about the reverse

(to snapblocks ({say (join [That's cool, but when ] (multiline [{\{test\} :: define+
say \(join \[snapblocks into \] \(\(block defintions\) \@addInput\) $delInput$verticalEllipsis$addInput}] :: operators) [?] @delInput @verticalEllipsis @addInput) for (2) secs} @addInput) definition? <f> :: #03c03c)

<not([global? V] of block ({} ::circle ring @addInput))>

You have to use capital V for readonly dropdown menus.

<not ([global? V] of block ({} @addInput))>
<not ([global? V] of block ({} @addInput))>

I think I should create a topic that explains everything in snapblocks, so people can learn how to use it if the main documentation site is blocked.

Would you be willing to make a snapblocks to Snap converter

Yeah, I have some ideas on how to do it, but it would be a feature in the snapblocks library, since snapblocks already gives enough info for me to analyze the blocks. The real problem is detecting all the slots in a variadic input.

got it

So it would be a custom block? Because doesn’t a feature in the website make more sense? What is the issue with variadic inputs?

Snapblocks is a javascript library, not a snap library, so it wouldn't be implemented in snap.

The problem with variadic inputs is, you can stick a normal input before variadic inputs, you can set a separator, multiple expand labels, collapsed labels, and many other complications. If I came up with a system in the snapblocks syntax that allows users to group inputs to become a variadic input, then maybe, but if I'm being honest, no one is gonna use that, so it's best if I don't bother.

Oh ok.

Maybe its possible to generate an image with the metadata in it and copy it to the clipboard or something. Or even better, a way to press a button in the forum and have it become attached to your cursor when you go to snap!

The point of snapblocks is to be able to generate snap block images from text. If you use this convertor to convert a script (that is already is snap), render the blocks into snapblocks, then embed the script xml into the image to allow forum users to import this resulting image into snap to get the blocks back, then that is completely and utterly useless, because snap already embeds the script xml in script pics. Converting snapblocks to snap xml would allow users to turn text into runnable snap scripts without having to open the editor. Embedding the xml into an image is not the hard part, it's actually converting snapblovks to importable snap xml (and also handle custom blocks users create in snapblocks).

for me the only reason i would use snap blocks is for really long scripts and better render quality than script pics. if you script pic something very large, it looks tiny in the forum. snapblocks solves this issue. i still feel like it would be a great feature to be able to copy from on to the other and vice versa.

Don't get me wrong, I do want to create a snapblocks to snap convertor, and I believe it would be very useful, it's just figuring out how to group all the slots in a variadic input would be very difficult, and would be the main obstacle.

You can actually put snapblocks in a link, like this (only eith [sb] though).

[[sb]
test
script
[/sb]](https://example.com)

test script

Which you can also have it link to a script pic, which you might then be able to drag it into snap. For example:

script variables ((step)) @addInput set [step V] to (([[width] V] of [Stage V] :: sensing) / (200)) forever { warp { go to x: (-300) y: (-170) clear pen down for ((i)) = (1) to (200) { go to x: ((x position) + (step) @delInput @verticalEllipsis @addInput) y: ((item (i) of (microphone [[samples] V])) − (170)) } pen up } }

(I don't know if you can drag and drop it into snap, because I'm currently on my phone for the day).

you cant import it because its a link not an image

Except, the actual sb code isnt stored anywhere besides the actual message content. But, if it's stored potentially in the <alt> tag of the svg, it could be paired with ego-lay's potential snap blocks to snap

I'm pretty sure they were talking about the snap xml of the snapblocks, which you would need to be able to convert snapblocks to snap xml first, so I'm not thinking about that right now.

will this project be updated for snap 10.1?

I'm pretty sure it should still work, since I coded in the input groups a while ago (since I'm pretty sure the new input groups use the same format).

If it doesn't work, then I'll update it.