*NOTE: This only works on Windows, as far as I know!*
Note: Instructions are for Windows Vista Home Premium. Steps may differ for other versions of Windows.
Note: When I am able, I'll upload some screenshots to help.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LS97 reminded me of something:
LS97 wrote:
Ehm, let me just share a small tip with you:
Make sure you have some sort of backup copy of whatever project you're trying to edit. I accidentally messed up one of my projects, and good thing I had it shared on Scratch. Otherwise, would've lost it for sure.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Did you ever think there might be a way to edit Scratch projects outside of the program? If you did, you are right, I think. Projects can be opened, viewed, and saved from Notepad. When I tried, it caused an error, but I had no idea what I was doing.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Instructions:
A: Creating the Project
1) Open up Scratch.
2) Delete the Scratch Cat, it will make it easier.
3) Put a when green flag clicked block into the Stage.
4) Save it as "flag" with no author or project notes.
B: Opening the Project
1) Go into the folder where you saved it.
2) Single-click on the file.
3) The bar above (Vista) should read this:
Organize v Views v Open v E-mail Share Burn
4) Click the drop-down for Open.
5) If "Notepad" is an option, click it. If not, follow the following steps:
I) Click "Choose Default Program" at the bottom.
II) Click the "Browse" button.
III) Paste this into the address bar: (Replace USERNAME with your account)
C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories
IV) Click on Notepad.
V) Click Open.
VI) Uncheck the "Always use the selected program to open this kind of file" option.
VII) Click OK.
C: Understanding the Project
This is the difficult part.
You should now have the file flag.sb open in Notepad.
It should look like this, more or less:
ScratchV02 pObjSStch c c c c c c c c c c c c c c c c history >2011-5-31 15:52:59 save flag 2011-5-31 15:53:32 save flag platform Win32 language en os-version NT scratch-version 1.4 of 30-Jun-09 thumbnail# x c c comment author âXéaÿ c c ?ÿÿÿObjSStch }c c c c c c c c ?ð c d <c c ! àh ?ÿÿÿ Stage c c c ¢c c c c c ¤c c d 2 background1"àh c ð ´ l@Z@ c popmc € c + € õÿ Ta c c Õ½ rïS#<$› â«sñUÚ_Ä`³©i¨’±åÅGáAó&íGÑaJo}p#a DÎêó*ɧj‘ý%˜îµ9Ýèâ:`Dvpyµh¢EØgäJµl’zÞ†kŸqÈŽü!0â]}yßäq7M©¶ç©¸O–Œ‰‘i®OÙõ\< _PoïiNV$ òqÅY£g“¶™x²øÚh £6ŽWkf)_¢F¼õòÈÊõ¢Î«Ä2êñÀ9«Q(VñI4+NÛ,º¾¨ì©¼ÑÝŒ¼.<K€YR'9]¬êÅq§)³ºÐö°¥?zQÈQÊ?k}ùçÖÓ¾¶¾UÕ¬õ¼*3‚Aõ@„/,òW՟ó¿õËtãœz z6‰?†8Ò$:Ãç’ο†ÀÏéQk%~: A8µ#–Sè/ÏVÂ*ÂêÑZêI"”5×<Ð5ì#J ZîGØËwË Öfêo±’*30x+ª<ôódá¿×¸Öö߬ïÍ)\#¨H«¯óRæpߺàÛé3öÌ$ÛòJ„É|òäç5á á†èzôg¡,_Œ^=þtòçêÊç–é„ïàøùÔJ’Ù 7ûyöô–õÝù×ÿŽ— ŠUþa EventHatMorph Scratch-StartClicked
As you can see, if uses characters not even supported by the Scratch Forums!
See, down at the bottom, it says
EventHatMorph Scratch-StartClicked
This is the block.
D: Editing the Project From Notepad
*NOTE: This has produced an error whenever I tried it! If you get it to work, PLEASE tell how!*
1) Open a new file in Notepad, preferably in a new window, not by pressing "New" in the file menu.
2) Copy and paste the entire contents of the flag.sb file into the new window.
3) Remove the bottom line of text:
EventHatMorph Scratch-StartClicked
4) Save, as test.sb.
Make Sure It Is Called Test.sb, Not Test.txt!
5) Open in Scratch. If you did everything like me, you will get this notice:
Could not read project; file may be damaged:
(Attempt to set the position of a PositionableStream out of bounds)
It seems it can't be edited in Notepad after all.
But, there's hope! Try using Notepad++, which keeps byte information.
Last edited by scimonster (2011-12-31 13:53:13)
Offline
Works on macs too.
Offline
Hardmath123 wrote:
Works on macs too.
Can you give me the instructions? Also, I thought Notepad was in Windows.
Offline
Taneb wrote:
There're more text editors than Notepad, Scimonster
I know. Can I have the instructions and program to do it on a Mac?
Offline
Actually you can open any software or project or file in notepad.
Offline
It works for the opening part, but saving doesn't.
This is because notepad is a text editor and saves whatever file in an ASCII format, regardless of the bytes in it. Some bytes are then obviously lost. I think Visual Studio should do the trick
EDIT
I tried it in Visual Studio 2010 Professional, and it worked!
I limited myself to simply changing the text in a costume, but I'm sure it'll work for more complicated editing too.
We just have to look in each object's saving method to see how it saves data, and we can change the bytes of the file accordingly.
Last edited by LS97 (2011-05-31 11:31:41)
Offline
LS97 wrote:
It works for the opening part, but saving doesn't.
This is because notepad is a text editor and saves whatever file in an ASCII format, regardless of the bytes in it. Some bytes are then obviously lost. I think Visual Studio should do the trickEDIT
I tried it in Visual Studio 2010 Professional, and it worked!
I limited myself to simply changing the text in a costume, but I'm sure it'll work for more complicated editing too.
We just have to look in each object's saving method to see how it saves data, and we can change the bytes of the file accordingly.
Really?
I'll have to get this Visual Studio.
Offline
scimonster wrote:
LS97 wrote:
It works for the opening part, but saving doesn't.
This is because notepad is a text editor and saves whatever file in an ASCII format, regardless of the bytes in it. Some bytes are then obviously lost. I think Visual Studio should do the trickEDIT
I tried it in Visual Studio 2010 Professional, and it worked!
I limited myself to simply changing the text in a costume, but I'm sure it'll work for more complicated editing too.
We just have to look in each object's saving method to see how it saves data, and we can change the bytes of the file accordingly.Really?
I'll have to get this Visual Studio.
If you're willing to pay 600 pounds, go ahead.
Or you can register via Dreamspark, like I did. You get heaps of free stuff!
Offline
Try a hex editor (like XVI32) or Notepad++. Actually, I'll try one of those now.
Edit: Yes! I used XVI32 to remove the code for the green flag hat block, and when I opened it in Scratch, it wasn't there!
Edit: Oh wait, I never actually opened the project. *facepalm* I opened it, but I got a "key not found" error. But there's probably more to it than just removing that bit. (I actually saw the Scratch Cat sprite on the stage in the preview when I went to open it, so it worked partially.)
Last edited by meowmeow55 (2011-05-31 12:31:58)
Offline
LS97 wrote:
scimonster wrote:
LS97 wrote:
It works for the opening part, but saving doesn't.
This is because notepad is a text editor and saves whatever file in an ASCII format, regardless of the bytes in it. Some bytes are then obviously lost. I think Visual Studio should do the trickReally?
I'll have to get this Visual Studio.If you're willing to pay 600 pounds, go ahead.
Or you can register via Dreamspark, like I did. You get heaps of free stuff!
Is there a free program that works well too?
Offline
scimonster wrote:
LS97 wrote:
scimonster wrote:
Really?
I'll have to get this Visual Studio.If you're willing to pay 600 pounds, go ahead.
Or you can register via Dreamspark, like I did. You get heaps of free stuff!
Is there a free program that works well too?
Maybe Visual Studio Express allows you to open the same files... download here
Offline
I tried to edit the costume name in XVI32, but I still got the key not found error. D:
Offline
Ehm, let me just share a small tip with you:
Make sure you have some sort of backup copy of whatever project you're trying to edit. I accidentally messed up one of my projects, and good thing I had it shared on Scratch. Otherwise, would've lost it for sure.
Offline
LS97 wrote:
Ehm, let me just share a small tip with you:
Make sure you have some sort of backup copy of whatever project you're trying to edit. I accidentally messed up one of my projects, and good thing I had it shared on Scratch. Otherwise, would've lost it for sure.
I added that up in the top.
Offline
you can get a free trial for visual studio at http://www.microsoft.com/visualstudio/en-us.
does any body know other text editors that might work?
Offline
Omg This Is Amazing
Offline
scimonster wrote:
*NOTE: This has produced an error whenever I tried it! If you get it to work, PLEASE tell how!*
The file format is rather complicated. It was originally documented here, but it's a little out-of-date now. I'm writing a little Python parser for it, and I made a little wiki to document my findings.
The reason it produces an error when you do that is, I think, because the objects reference each other; so if you insert or delete objects in the file or change the order, it messes up those references.
With a lot of effort, one probably could edit Scratch files by hand, given a good hex editor — but I'm not sure if it's worth it
Offline
For hex editors, I use Hex Fiend on a Mac.
meowmeow55 recommended XVI32 for Windows in this thread. I haven't tried it, but it might still help you (:
Offline
Also, the file format states the number of blocks in the project, as well as many other pieces of important data regarding the project (consult blob8108's wiki for more in depth information). In short, one block could change the entire file.
Offline
Okay, modified the instructions for Mac OS X:
Instructions:
A: Creating the Project
1) Open up Scratch.
2) Delete the Scratch Cat, it will make it easier.
3) Put a when green flag clicked block into the Stage.
4) Save it as "flag" with no author or project notes.
B: Opening the Project
1. Open TextEdit
2. Go to the folder with "flag.sb"
3. Click "flag.sb"
C: Understanding the Project
This is the difficult part.
You should now have the file flag.sb open in TextEdit.
It should look like this, more or less:
ScratchV02 pObjSStch c c c c c c c c c c c c c c c c history >2011-5-31 15:52:59 save flag 2011-5-31 15:53:32 save flag platform Win32 language en os-version NT scratch-version 1.4 of 30-Jun-09 thumbnail# x c c comment author âXéaÿ c c ?ÿÿÿObjSStch }c c c c c c c c ?ð c d <c c ! àh ?ÿÿÿ Stage c c c ¢c c c c c ¤c c d 2 background1"àh c ð ´ l@Z@ c popmc € c + € õÿ Ta c c Õ½ rïS#<$› â«sñUÚ_Ä`³©i¨’±åÅGáAó&íGÑaJo}p#a DÎêó*ɧj‘ý%˜îµ9Ýèâ:`Dvpyµh¢EØgäJµl’zÞ†kŸqÈŽü!0â]}yßäq7M©¶ç©¸O–Œ‰‘i®OÙõ\< _PoïiNV$ òqÅY£g“¶™x²øÚh £6ŽWkf)_¢F¼õòÈÊõ¢Î«Ä2êñÀ9«Q(VñI4+NÛ,º¾¨ì©¼ÑÝŒ¼.<K€YR'9]¬êÅq§)³ºÐö°¥?zQÈQÊ?k}ùçÖÓ¾¶¾UÕ¬õ¼*3‚Aõ@„/,òW՟ó¿õËtãœz z6‰?†8Ò$:Ãç’ο†ÀÏéQk%~: A8µ#–Sè/ÏVÂ*ÂêÑZêI"”5×<Ð5ì#J ZîGØËwË Öfêo±’*30x+ª<ôódá¿×¸Öö߬ïÍ)\#¨H«¯óRæpߺàÛé3öÌ$ÛòJ„É|òäç5á á†èzôg¡,_Œ^=þtòçêÊç–é„ïàøùÔJ’Ù 7ûyöô–õÝù×ÿŽ— ŠUþa EventHatMorph Scratch-StartClicked
As you can see, if uses characters not even supported by the Scratch Forums!
See, down at the bottom, it says
EventHatMorph Scratch-StartClicked
This is the "When Flag Clicked" block.
D: Editing the Project From TextEdit
*NOTE: This has produced an error whenever I tried it! If you get it to work, PLEASE tell how!*
1) Open a new file in Notepad, preferably in a new window, not by pressing "New" in the file menu.
2) Copy and paste the entire contents of the flag.sb file into the new window.
3) Remove the bottom line of text:
EventHatMorph Scratch-StartClicked
4) Save, as test.sb.
Make Sure It Is Called Test.sb, Not Test.txt!
5) Open in Scratch. If you did everything like me, you will get this notice:
Could not read project; file may be damaged:
(Attempt to set the position of a PositionableStream out of bounds)
It seems it can't be edited on the Mac after all.
Offline
blob8108 wrote:
meowmeow55 recommended XVI32 for Windows in this thread
As I did in this one, waaay back when it was posted
Offline
this works on any computer everythere i dont know why some people think its not compatible just because there using a different program also i would never edit code with notepad i always do it in notepad++
Offline
*smack face*
I learned this back from my SMW Galaxy days.
Notepad replaces NUL characters (look like (NUL) in text editors) with spaces when you save.
Offline