Eng:Scratch File Format (1.4)/Project File


 * This is a technical description of the file format. For projects in general, see Project.

Project files are used by Scratch to save all the information - stage, sprites, scripts, sound, images - in a Scratch project to a single file.

They have the extension.

Structure
The basic structure of a project file is as follows:
 * : A 10-byte header encoding the ASCII string.
 * : 32-bit (unsigned?) integer length of the infoObjects table in bytes
 * : a dictionary serialised to an Object Table. Contains information like the author, notes, and thumbnail/preview image.
 * : (remaining bytes) the actual project media, including scripts and sounds.

The header is simply the 10-byte string  encoded as ASCII.

Files saved by mods may have different headers; thus it is useful to know which modification created the project. For example, BYOB stores.

infoSize encodes the length of the given file's infoObjects (see below). The infoSize is four bytes long, and is a 32-bit big-Endian integer.

This is a set of vital pieces of information about a file. It is used for:
 * Validating projects
 * Creating quick thumbnails and descriptions

It uses a simple Dictionary format: it consists of alternating pieces of ASCII keys and values. The keys currently in use are:
 * thumbnail: small image of project when saved
 * author: author of the project (usually username)
 * comment: the Project Notes
 * history: save/upload history
 * scratch-version: the version of Scratch which saved the file

This is a second Object Table, with the Stage as the root object. All media, sprites, scripts, etc. are encoded as References from the main stage object.