The Is a successful block importer/Patch importer I made!
use this block importer:
open workspace and enter:
'From MIT Squeak 0.9.4 (June 1, 2003) [No updates present.] on 18 June 2010 at 5:06:17 pm'!
!ScratchFileChooserDialog methodsFor: 'initialization'!
createBlockFileChooserFor: t1
scratchFrame _ nil.
readingScratchFile _ true.
list _ ScratchFilePicker new extensions: #(#block ).
self removeAllMorphs.
bottomSpacer delete.
bottomSpacer _ nil.
mainColumn addMorphBack: list.
self title: 'Import Block'.
list scratchInfoClient: nil.
mainColumn addMorphBack: (Morph new extent: 5 @ 9;
color: Color transparent);
addMorphBack: newTitleBin.
fileInfoColumn addMorphBack: buttonRow.
self addMorphBack: shortcutColumn;
addMorphBack: mainColumn;
addMorphBack: fileInfoColumn! !
!ScratchFileChooserDialog methodsFor: 'initialization'!
createPatchFileChooserFor: t1
scratchFrame _ nil.
readingScratchFile _ true.
list _ ScratchFilePicker new extensions: #(#patch ).
self removeAllMorphs.
bottomSpacer delete.
bottomSpacer _ nil.
mainColumn addMorphBack: list.
self title: 'Import Patch'.
list scratchInfoClient: nil.
mainColumn addMorphBack: (Morph new extent: 5 @ 9;
color: Color transparent);
addMorphBack: newTitleBin.
fileInfoColumn addMorphBack: buttonRow.
self addMorphBack: shortcutColumn;
addMorphBack: mainColumn;
addMorphBack: fileInfoColumn! !
!ScratchFrameMorph methodsFor: 'menu/button actions'!
addPatch
| t1 t2 t3 t4 |
t1 _ ScratchFileChooserDialog new createPatchFileChooserFor: self;
type: #patch.
t2 _ t1 getUserResponse.
t2 = #cancelled ifTrue: [^ self].
t3 _ (FileDirectory forFileName: t2)
oldFileNamed: t2.
t4 _ t3 contentsOfEntireFile.
(ReadWriteStream
on: t4
from: 1
to: t4 size) fileIn! !
!ScratchFrameMorph methodsFor: 'menu/button actions'!
addBlock
| t1 t2 t3 t4 |
t1 _ ScratchFileChooserDialog new createBlockFileChooserFor: self;
type: #block.
t2 _ t1 getUserResponse.
t2 = #cancelled ifTrue: [^ self].
t3 _ (FileDirectory forFileName: t2)
oldFileNamed: t2.
t4 _ t3 contentsOfEntireFile.
(ReadWriteStream
on: t4
from: 1
to: t4 size) fileIn! !
!ScratchFrameMorph methodsFor: 'menu/button actions'!
fileMenu: t1
| t2 |
t2 _ CustomMenu new.
t2 add: 'New' action: #newScratchProject.
t2 add: 'Open' action: #openScratchProject.
t2 add: 'Save' action: #saveScratchProjectNoDialog.
t2 add: 'Save As' action: #saveScratchProject.
t2 addLine.
t2 add: 'Import Project' action: #importScratchProject.
t2 add: 'Export Sprite' action: #exportSprite.
t2 addLine.
t2 add: 'Import Patch' action: #addPatch.
t2 add: 'Import Block' action: #addBlock.
t2 addLine.
t2 add: 'Project Notes' action: #editNotes.
Sensor shiftPressed
ifTrue:
[t2 addLine.
t2 add: 'Write Project Summary' action: #writeSummaryFile.
t2 add: 'Write Multiple Project Summaries' action: #writeMultipleSummaries].
t2 addLine.
t2 add: 'Quit' action: #quitScratch.
t2 localize.
#(2 4 5 6 7 8 ) do: [:t3 | t2 labels at: t3 put: ((t2 labels at: t3)
copyFrom: 1 to: (t2 labels at: t3) size - 1)
, ScratchTranslator ellipsesSuffix].
t2 invokeOn: self at: t1 bottomLeft + (0 @ 10)! !Enjoy!
Last edited by PopTarties (2012-07-22 12:01:28)
Offline
I'm sorry, but didn't dreamod already do this?
http://scratch.mit.edu/projects/dreamod/2482921
Last edited by Greenatic (2012-07-20 16:40:22)

Offline
i didn't know about dreammod when i made this
Offline
PopTarties wrote:
i didn't know about dreammod when i made this
You should still change it to the second working .block file ever made.
Offline