In other languages

Help the wiki!

The Scratch Wiki is made by and for Scratchers. Do you want to contribute?

Learn more about joining as an editor!

See discussions in the Community Portal

Porting Scratch Projects

SandCastleIcon.png This page has links to outside of the Scratch website or to Wikipedia. Always remember to be safe when using the internet since we can't guarantee the safety of other sites.

The Scratch project format (.sb or .sb2) can only be read by the Scratch editor. Compiling a scratch project can convert it to another format that can be opened without scratch. Compiling was a popular suggestion for Scratch 2.0,[1] However, it wasn't added in the normal online or offline editors. To get around this, several Scratchers have made ways to turn them into more widely known formats such as exe and app.

This tutorial will cover how to turn a Scratch project into various executable file formats for Windows, Macintosh and Linux.

Scratch online to EXE

Warning Note: This only works on Windows Vista or higher.

A help video is available documenting how to use this tool.

  1. Download the Scratch to EXE converter from here

After you download the installer, you may need to disable your antivirus to allow the converter to work correctly. Then open the installer and click install, then wait until a message appears telling you your install is finished.

  1. Open the downloaded program, then read the help tab if necessary
  2. On the second tab enter your project ID in the box. This is the long number in all scratch project URL's. For example, if your project URL is https://scratch.mit.edu/projects/128316889/, then the ID would be 128316889.
  3. On the third tab fill in the details as described in the help tab. It is also required that you have a .ico file to use as the icon.
  4. Finally, on the fourth tab, find a folder to save your EXE and click build.

Notes

  • Forgetting to include a .ico icon file will cause a compile error.
  • The executable file must be in the same folder as the other files. In order to include all files in one downloadable file, use a ZIP archive.

SB2 (Scratch 2.0) to SB (Scratch 1.4)

It is possible for one to convert an SB2 file from Scratch 2 to a Scratch 1.4 SB file using blob8108's Retro Converter. Then, if desired, other tools can be used to port it to various formats.

Warning Note: The converter can only convert 1.4 blocks. It cannot convert 2.0 This means converted projects cannot use clones, cloud, custom blocks, or other new Scratch 2.0 features.

SB2 to SB

  1. Download your 2.0 project from the Scratch Website or the 2.0 Offline Editor.
  2. Go to the Retro Converter and follow the instructions there to convert to SB.
  3. Once converted, a pop-up should appear and you will be able to download a 1.4 version (SB) of your 2.0 (SB2) Scratch project.

SB to Other Formats

  1. Now, follow the other Scratch 1.4 tutorials on this page to convert to various other formats.

SB to EXE/APP

Warning Note: This converts to an EXE on Windows, and an APP on Mac OS X.
Warning Note: This only works for Scratch 1.4 and earlier.
  1. Install BYOB (see resources and links for a link to the website).
  2. Open your SB file.
  3. Click "Compile this project" under the Share menu.

Compile.png

SB to JAR (Java executable)

Warning Note: This only works for Scratch 1.4 and earlier.

This method works on all operating systems with a Java runtime installed, including Mac, Windows, and Linux.

  1. Download ToJAR (see resources and links)[2]
  2. Unpack/extract the .zip file
  3. In the ToJAR folder, double click on the program folder, then on the dist folder and then double click on the ToJAR.jar file.
  4. This will launch the ToJAR application which looks like this:
    inline
  5. Click the first select button and choose the input (SB) file.
  6. Choose your output name, and be sure to append the .jar file extension, for example Example.jar
  7. Choose your output location, being sure to put the name of your JAR file at the end. For example, C:/Documents and Settings/Documents/Example.jar
  8. Click "Compile"

SB to APP via Java

Warning Note: This only works on Mac OS X.
  1. Follow the steps above to make a JAR file.
  2. Find and launch the Jarbundler application, which should look like this:

Jarb.png

  1. From the tabs at the top, the first tab says build information. You can set a custom icon in this tab if you wish. The icon must be in .icns format (use Icon Composer (comes with Mac) to convert a PNG file into .icns format). If no icon is provided, the icon shown will be used).
  2. Select the JAR file you created in toJAR as the Main Class.
  3. Click the button at the bottom that says Create Application...
  4. Choose an output folder to save your project in

SB2 to SWF

You can download a SB2 to SWF converter or use an online converter at this site.

Resources and Links

References

  1. https://web.archive.org/web/20120101192818/http://suggest.scratch.mit.edu/forums/60449-suggestions/suggestions/1240331-built-in-scratch2exe
  2. Forum topic
  • This page was last modified on 6 December 2016, at 03:03.