Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Leopard: Edit Scratch projects as JavaScript code
- ProCraftPlays04
-
2 posts
Leopard: Edit Scratch projects as JavaScript code
All right that is my simple talking engine But wait why is it not working It's because data cannot confirm That it is in the positive or the negatives So when they take those scripts to The Javascript If you make a simple mistake It will transport data into those errors so there
okay but how do I make it so the game works but i can convert it?
- dumorando
-
100+ posts
Leopard: Edit Scratch projects as JavaScript code
Argument sandboxId for data.sandboxId is missing.
- smolyhokes
-
22 posts
Leopard: Edit Scratch projects as JavaScript code
https://scratch.mit.edu/projects/829354774/ why doesnt this work
- itamar_eiz
-
1 post
Leopard: Edit Scratch projects as JavaScript code
hello.
I tried to convert my project to javascript but it didn't work.
the project is in scratch 3.0 and has no extentions.
what can I do?
project: https://scratch.mit.edu/projects/1000718832/
I tried to convert my project to javascript but it didn't work.
the project is in scratch 3.0 and has no extentions.
what can I do?
project: https://scratch.mit.edu/projects/1000718832/
- dash_master
-
1 post
Leopard: Edit Scratch projects as JavaScript code
Hi, So I have a cool project i am making, and I wanted to make it on a different game engine without going through 18 hours of work, but whenever I try to convert it, the only way that has worked was an html convert, but then when I try to convert the HTML to java or javascript, it gives me an error, like everything else. I don't know whats wrong with it, because I think it's supposed to work with the web version of today. Could someone please tell me what I am doing wrong? Leopardjs gave me an error when i uploaded it and gave it the link and it said “Argument sandboxId for data.sandboxId is missing.”
Here is the project: https://scratch.mit.edu/projects/942467711
Also I really hope it's not because of blank values because this won't work without them
Here is the project: https://scratch.mit.edu/projects/942467711
Also I really hope it's not because of blank values because this won't work without them
Last edited by dash_master (April 19, 2024 18:44:54)
- dynamicsofscratch
-
1000+ posts
Leopard: Edit Scratch projects as JavaScript code
im just gonna bump this to encourage discussions 

- key-lock
-
19 posts
Leopard: Edit Scratch projects as JavaScript code
this one doesn't work for some reason:
https://scratch.mit.edu/projects/962830949/
the only extension if pen
https://scratch.mit.edu/projects/962830949/
the only extension if pen
- key-lock
-
19 posts
Leopard: Edit Scratch projects as JavaScript code
*is pen this one doesn't work for some reason:
https://scratch.mit.edu/projects/962830949/
the only extension if pen
- dynamicsofscratch
-
1000+ posts
Leopard: Edit Scratch projects as JavaScript code
(#1011)see the https://leopardjs.com/manual?p=motion*is pen this one doesn't work for some reason:
https://scratch.mit.edu/projects/962830949/
the only extension if pen
- PullJosh
-
1000+ posts
Leopard: Edit Scratch projects as JavaScript code
Good news! There is now a solution for the “Argument sandboxId for data.sandboxId is missing” message.
Have you ever tried converting a project and seen an error like this?

Well now there is a solution. This error appears when your converted project cannot be uploaded to CodeSandbox. Now, instead of converting on the cloud, there is a new feature: You can now convert Scratch projects to Leopard code locally, on your own computer. You don't need to use the leopard website and you don't need to use CodeSandbox.
Here's how it works. Under the hood, we've created a library called “sb-edit” that converts projects between different Scratch file formats. In this case, from a .sb3 Scratch project file into Leopard code. This tool now has a command-line option that lets you run it from your very own computer's terminal.
To run the terminal converter, there are just two steps.
First, use npm to install the sb-edit package globally (so it can be used from anywhere on your machine).
(If you don't have node/npm or haven't used it, it is a tool that helps you run JavaScript code, like sb-edit, from the terminal on your computer. To get npm, install node.js from the official website. When you install node, the npm package manager will come with it.)
Then, you can convert a .sb3 file (which you can download from the Scratch editor by clicking File > Save to your computer) to a Leopard project using the following command:
This command will take your input sb3 file and generate a folder full of Leopard code at the output directory you specify. Obviously, you should edit the input and output paths in the command above to match the actual locations of the input file and desired output folder on your computer.
If you want to generate a .zip file instead of a folder, you can do that as well. Just set –output to be a path with a .zip filename.
Have you ever tried converting a project and seen an error like this?

Well now there is a solution. This error appears when your converted project cannot be uploaded to CodeSandbox. Now, instead of converting on the cloud, there is a new feature: You can now convert Scratch projects to Leopard code locally, on your own computer. You don't need to use the leopard website and you don't need to use CodeSandbox.
Here's how it works. Under the hood, we've created a library called “sb-edit” that converts projects between different Scratch file formats. In this case, from a .sb3 Scratch project file into Leopard code. This tool now has a command-line option that lets you run it from your very own computer's terminal.
To run the terminal converter, there are just two steps.
First, use npm to install the sb-edit package globally (so it can be used from anywhere on your machine).
npm i -g sb-edit
Then, you can convert a .sb3 file (which you can download from the Scratch editor by clicking File > Save to your computer) to a Leopard project using the following command:
sb-edit --input path/to/project.sb3 --output path/to/output-folder
If you want to generate a .zip file instead of a folder, you can do that as well. Just set –output to be a path with a .zip filename.
Last edited by PullJosh (April 30, 2024 21:17:34)
- star_wolves1
-
29 posts
Leopard: Edit Scratch projects as JavaScript code
you can also use turbo warp: https://turbowarp.org/Please use this thread to discuss Leopard, share your projects, and ask for help.
That's right! Translating Scratch to JavaScript is now possible! The tool is called Leopard, and it's available here:Leopard Website – Go here to convert your projects!
Who needs this?
Scratch is amazing. This is the place where I learned to code almost 9 years ago. I love the Scratch community, and the fact that it's so easy to get started with Scratch. However, many of the features that make it easy to start using Scratch also make it underpowered for more experienced programmers.
With a different programming language like JavaScript, you get:If you want to try a different programming language but find it difficult to get started, Leopard can help.
- More features: You can do cool tricks that simply aren't possible with Scratch.
- Speed: Your projects run faster and lag isn't as problematic.
- Publishing options: Run your projects on any website, not just Scratch.
How is this different than Phosphorus?
Phosphorus is awesome, but it's a little different than Leopard. With Leopard you can view and edit the translated JavaScript code yourself.
What if it doesn't work?
Not every project will translate perfectly.
- Only projects created using Scratch 3.0 can be translated. If you created your project using Scratch 2.0 or older, you'll need to open it up in the Scratch 3.0 editor, make a small change, and then try again.
- Some Scratch blocks are not yet supported. Check the translations page to see which blocks have JavaScript equivalents using Leopard. More blocks will be supported over time.
- Extension blocks won't work (except pen, which works great!)
- Sometimes there are little inconsistencies. We've done our best to make sure Leopard behaves exactly the same as Scratch, but there will always be little cases we haven't considered. It's possible that your scripts will run slightly out of order, be a little too fast, or some other issue. Fortunately, you can edit the JavaScript code to fix those issues, and I'm happy to help.
Thank you so much to the contributors who made Leopard possible!
#1013May 1, 2024 06:48:02
- julmik6478
-
500+ posts
Leopard: Edit Scratch projects as JavaScript code
Non translated list:
when backdrop switches to [backdrop 1 v]- extensions other than pen
set drag mode [draggable v]::sensing
set drag mode [undraggable v]::sensing
([volume v] of [Sprite1 v])
(username)
(☁ cloud variables)
#1014May 1, 2024 06:49:48
- julmik6478
-
500+ posts
Leopard: Edit Scratch projects as JavaScript code
I have translation for makey makey block:
when [space v] key pressed::pennew Trigger(Trigger.KEY_PRESSED, { key: “space” }, this.myScript)
#1015May 1, 2024 07:08:44
- julmik6478
-
500+ posts
Leopard: Edit Scratch projects as JavaScript code
Translations of two hacked blocks:
// do something fun here
yield;
}
while <> {}::controlwhile ((/* condition */)) {
// do something fun here
yield;
}
loud::sensing booleanthis.loudness > 10
#1016May 1, 2024 07:25:31
- julmik6478
-
500+ posts
Leopard: Edit Scratch projects as JavaScript code
New idea for username:
This.username = user
Default username: user
Scratch compatiblity idea:
set username [user]::sensingjavascript:
This.username = user
Default username: user
Scratch compatiblity idea:
leopard.set username [user]All custom blocks with this name are replaced with this javascript.
Last edited by julmik6478 (May 1, 2024 07:32:23)
#1017May 3, 2024 15:24:39
- CodesNorth
-
88 posts
Leopard: Edit Scratch projects as JavaScript code
Does Leopard also convert the costumes/art into javascript, or just the code?
#1018May 3, 2024 15:36:56
- PullJosh
-
1000+ posts
Leopard: Edit Scratch projects as JavaScript code
The costumes and sounds stay the same. In your converted project, they are just stored as files. And those files can be read and displayed using JavaScript code. Does Leopard also convert the costumes/art into javascript, or just the code?
#1019May 3, 2024 17:50:27
#1020May 7, 2024 19:00:38
- ImDumbLol696
-
7 posts
Leopard: Edit Scratch projects as JavaScript code
(long unnecessary quote removed by moderator - please don't spam)
None of my projects work, idk why
None of my projects work, idk why
Last edited by Paddle2See (May 8, 2024 10:24:38)