ScratchAddons icon indicating copy to clipboard operation
ScratchAddons copied to clipboard

Text version of scratch.

Open OriLiMu opened this issue 1 year ago • 5 comments

Why this would be helpful

Mostly talked in this discussion #7660

The meaning of this I think is just tired of the drag & drop things is too Inefficiency work which is better for kid but terrible work for adults who want to make some complicated things. I see that the sb3 file can be unzipped. There is a json file contains all the code. Find a way to edit it nicely would be a way to make it.

My suggestion

Here is what I think: 3 main steps of this:

  1. make a new language (just called scratch-text here). Write script with it and save it as a file. Then use an addon to upload it to the current scratch editor. Translate the the scratch-text file to blocks append or write to the current sprite(or more complicated to append new blocks to different sprites ) This step will almost get rid of the drag & drop work. This step just put the block to the editor pane base on the script.
  2. make the script more functional which can deal with the non-block things like create a sprite, rename a sprite something upload a image to sprite. This step may take some time, may be a time-consuming work I think. May be can leave it first consider about step3.
  3. Make a vscode extension can connect to current editor with lsp things for scratch-text. And more important the change in the vscode can be send to scratch editor at the same time which will make the scratch much eaiser to use.

Possible alternatives

No response

Additional context

I'd like to ask some advice for it. And then I will work on it first, even through I havent make the things I mentioned above before.

OriLiMu avatar Jul 20 '24 17:07 OriLiMu

This is somewhat out-of-scope for our project.

WorldLanguages avatar Jul 20 '24 17:07 WorldLanguages

I think middle-click-popup does this fine enough

mybearworld avatar Jul 21 '24 16:07 mybearworld

If you're interested: https://tosh.blob.codes

A way how this could be implemented in Scratch is to simply display sb3 files in a different way (text instead of blocks), maybe with an additional "Code (text)" tab.

Suggested notation (click to open)
~ ... I'm a comment!
~ ... Definitions are in {} curly brackets:
~ variable { My Variable } for all sprites
~ variable { Cloudy } stored on the cloud
~ list { My List } for this sprite only
~ 
~ define { My Block {Parameter} } run without screen refresh
~ say (I'm a fixed value (number or string)!)
~ ... Variable values are in [] square brackets:
~ say [Parameter]
~ 
~ when green flag clicked
~ ... Squared drop-down menus are written as if they were part of the block:
~ set My Variable to (1)
~ 
~ ... Chained blocks are merged into 1 block:
~ My Block [join (apple )(banana )(orange)]
~ 
~ ... Indents are important!
~ forever
~   if [key (right arrow) pressed?] then
~     move (10) steps
~   else if [key (left arrow) pressed?] then
~     move (-10) steps

iqnite avatar Aug 05 '24 18:08 iqnite

Related: #6922

Samq64 avatar Aug 05 '24 19:08 Samq64

i think it would be more feasible to simply add an option to directly tamper with the project JSON, and possibly add syntax highlighting or formatting. But making a whole new language is too much.

This would make it significantly easier to tamper with project json, which would make saddons much more useful for the (small) project json hacking community, and make it easier for new scratchers to learn about scratch json hacking.

and if it were made in a way that other addons can attach to it, then you could have text based scratch with something like goboscript integration.

faretek1 avatar Sep 07 '25 17:09 faretek1