GP1

Hello. I am new to the format in which Scratch 1.4 is in, and I need to be able to write to a Scratch 1.4 file format via PHP. I searched the world out of the wiki, and looked over and over at the documentation for the format. And, I just do not understand it! Is there some simple source code that writes to a .sb file (perhaps reads). If not, could somebody be kind enough to explain exactly how writing would take effect? Thank you!

EDIT: Yes, yes, I know that the Scratch 2.0 file format is easier than the 1.4 format. However, I need to write specifically to the 1.4 format at first.

Hardmath123

If you're not bound to use PHP, blob8108 wrote an amazing library called Kurt to read and write Scratch 1.4 and 2.0 files with Python (you can run Python on servers, too, if that's why you wanted PHP).

EDIT: http://scratch.mit.edu/discuss/topic/12681/

GP1

Hardmath123 wrote:

If you're not bound to use PHP, blob8108 wrote an amazing library called Kurt to read and write Scratch 1.4 and 2.0 files with Python (you can run Python on servers, too, if that's why you wanted PHP).

EDIT: http://scratch.mit.edu/discuss/topic/12681/
That is actually what I am looking for! Do you happen to know which script the saving code is in, or do I have to find it myself (quick look and I couldn't find it ). I may be able to turn it into PHP code.

blob8108

The 1.4 file format is a bit of a mess. What precisely are you trying to do? Unless you're trying to write something very simple, it's probably not worth porting to PHP.

GP1

blob8108 wrote:

The 1.4 file format is a bit of a mess. What precisely are you trying to do? Unless you're trying to write something very simple, it's probably not worth porting to PHP.
http://scratch.mit.edu/discuss/topic/13101/
For functionality, I want full support of Scratch 1.4 first. Go Everywhere is a way to edit scratch projects on mobile devices, not a way to have something new altogether. I emailed the Scratch team about uploading Go Everywhere projects to the Scratch website. They have not responded, but I do not think that they would say no (since the projects do not have any modded material. They only have been edited in a different editor.) Because Go Everywhere is cheap, we can only use free webhosts with PHP installed (unless ssss can donate a paid server). And that means that PHP has to be our language to do this in. We can read Scratch 1.4 projects (thanks to MathWhiz, but I am extremely unsure about how he did it). We just need to be able to write to them.

nathanprocks

GP1 wrote:

blob8108 wrote:

The 1.4 file format is a bit of a mess. What precisely are you trying to do? Unless you're trying to write something very simple, it's probably not worth porting to PHP.
http://scratch.mit.edu/discuss/topic/13101/
For functionality, I want full support of Scratch 1.4 first. Go Everywhere is a way to edit scratch projects on mobile devices, not a way to have something new altogether. I emailed the Scratch team about uploading Go Everywhere projects to the Scratch website. They have not responded, but I do not think that they would say no (since the projects do not have any modded material. They only have been edited in a different editor.) Because Go Everywhere is cheap, we can only use free webhosts with PHP installed (unless ssss can donate a paid server). And that means that PHP has to be our language to do this in. We can read Scratch 1.4 projects (thanks to MathWhiz, but I am extremely unsure about how he did it). We just need to be able to write to them.
Why not read 1.4 projects and save them as 2.0 project?

GP1

nathanprocks wrote:

GP1 wrote:

blob8108 wrote:

The 1.4 file format is a bit of a mess. What precisely are you trying to do? Unless you're trying to write something very simple, it's probably not worth porting to PHP.
http://scratch.mit.edu/discuss/topic/13101/
For functionality, I want full support of Scratch 1.4 first. Go Everywhere is a way to edit scratch projects on mobile devices, not a way to have something new altogether. I emailed the Scratch team about uploading Go Everywhere projects to the Scratch website. They have not responded, but I do not think that they would say no (since the projects do not have any modded material. They only have been edited in a different editor.) Because Go Everywhere is cheap, we can only use free webhosts with PHP installed (unless ssss can donate a paid server). And that means that PHP has to be our language to do this in. We can read Scratch 1.4 projects (thanks to MathWhiz, but I am extremely unsure about how he did it). We just need to be able to write to them.
Why not read 1.4 projects and save them as 2.0 project?
My main reason is that the player we are using, JsScratch, reads from the 1.4 format. However, thank you for the suggestion! I had not considered it. I'll try it out. Just need to rewrite JsScratch a little.

djdolphin

In Mathwizz's sig there's a link to this javascript library for reading and writing scratch projects.

scimonster

Many free hosts also allow Python scripts.

GP1

djdolphin wrote:

In Mathwizz's sig there's a link to this javascript library for reading and writing scratch projects.
Ok, thanks!

scimonster wrote:

Many free hosts also allow Python scripts.
That is true, however most that I could find to not support both PHP and Python.