This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-03-31 13:53:17

danwoodski
Scratcher
Registered: 2009-12-23
Posts: 100+

Changing file extensions...

I don't know if anyone's ever asked this...but is there a way to change the file extension a project is saved in?


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://dl.dropbox.com/u/12506914/Pics/p2e-2.png&link2=http://dl.dropbox.com/u/12506914/Pics/ms.png&link3=http://dl.dropbox.com/u/12506914/Pics/block%20lib.png
Starting to move on to other languages, but I'll still be around from time to time  smile

Offline

 

#2 2011-03-31 13:55:51

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Changing file extensions...

There obviously is, but I don't know how...  hmm

Offline

 

#3 2011-03-31 14:43:55

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Changing file extensions...

There was a post like this not so long ago, maybe you should use the magical search bar up in the cornner to see if you can find it.


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#4 2011-03-31 15:58:18

wcfs96
New Scratcher
Registered: 2011-03-10
Posts: 37

Re: Changing file extensions...

Code:

ScratchFrameMorph>>saveScratchProject
fName _ (self nameFromFileName: fName), '.sb'. "Change .sb to your file extension"

ScratchFrameMorph>>saveScratchProjectNoDialog
(fName size = 0 | (dir fileExists: fName , '.sb') not) ifTrue: [^ self saveScratchProject]. "Again change .sb"
projectName _ FileDirectory localNameFor: (fName, '.sb').  "Once again change .sb"

ScratchFrameMorph>>nameFromFileName:
"Add this line change .sb to your file extension also change 3 to the length of your extension"
(s asLowercase endsWith: '.sb') ifTrue: [s _ s copyFrom: 1 to: s size - 3].

ScratchFileChooserDialog>>createScratchFileChooserFor:saving:
list _ ScratchFilePicker new extensions: #(scratch sb). "Add your extension"

I think that's everything, I just quickly look for 5 minutes. It should at least save and open correctly with the new extension  smile

Offline

 

#5 2011-04-08 18:49:48

PythonLibrary
Scratcher
Registered: 2011-03-26
Posts: 100+

Re: Changing file extensions...

wcfs96 wrote:

Code:

ScratchFrameMorph>>saveScratchProject
fName _ (self nameFromFileName: fName), '.sb'. "Change .sb to your file extension"

ScratchFrameMorph>>saveScratchProjectNoDialog
(fName size = 0 | (dir fileExists: fName , '.sb') not) ifTrue: [^ self saveScratchProject]. "Again change .sb"
projectName _ FileDirectory localNameFor: (fName, '.sb').  "Once again change .sb"

ScratchFrameMorph>>nameFromFileName:
"Add this line change .sb to your file extension also change 3 to the length of your extension"
(s asLowercase endsWith: '.sb') ifTrue: [s _ s copyFrom: 1 to: s size - 3].

ScratchFileChooserDialog>>createScratchFileChooserFor:saving:
list _ ScratchFilePicker new extensions: #(scratch sb). "Add your extension"

I think that's everything, I just quickly look for 5 minutes. It should at least save and open correctly with the new extension  smile

Can you tell me the first thing? Like blah >> ScratchFrameMorph?


http://dl.dropbox.com/u/9137793/Python%20Library%20logo.png
Our website: pylibrary.co.cc http://dl.dropbox.com/u/9137793/Awesomeness%20Block.gif

Offline

 

#6 2011-04-08 18:53:42

wcfs96
New Scratcher
Registered: 2011-03-10
Posts: 37

Re: Changing file extensions...

You mean the category? ScratchFrameMorph is in Scratch-UI-Panes and ScratchFileChooserDialog is in Scratch-UI-Dialogs. You can also do ctrl/alt - f to look for a class.

Offline

 

#7 2011-04-08 19:12:13

thebuilderdd
Scratcher
Registered: 2008-01-26
Posts: 1000+

Re: Changing file extensions...

wcfs96 wrote:

You mean the category? ScratchFrameMorph is in Scratch-UI-Panes and ScratchFileChooserDialog is in Scratch-UI-Dialogs. You can also do ctrl/alt - f to look for a class.

Oh. (Wrong account. Who cares?)

Offline

 

#8 2011-04-08 19:21:33

thebuilderdd
Scratcher
Registered: 2008-01-26
Posts: 1000+

Re: Changing file extensions...

wcfs96 wrote:

You mean the category? ScratchFrameMorph is in Scratch-UI-Panes and ScratchFileChooserDialog is in Scratch-UI-Dialogs. You can also do ctrl/alt - f to look for a class.

Another thing, for the last thing, what am I supposed to add/change?

Offline

 

#9 2011-04-30 13:33:30

PythonLibrary
Scratcher
Registered: 2011-03-26
Posts: 100+

Re: Changing file extensions...

wcfs96 wrote:

Code:

ScratchFrameMorph>>saveScratchProject
fName _ (self nameFromFileName: fName), '.sb'. "Change .sb to your file extension"

ScratchFrameMorph>>saveScratchProjectNoDialog
(fName size = 0 | (dir fileExists: fName , '.sb') not) ifTrue: [^ self saveScratchProject]. "Again change .sb"
projectName _ FileDirectory localNameFor: (fName, '.sb').  "Once again change .sb"

ScratchFrameMorph>>nameFromFileName:
"Add this line change .sb to your file extension also change 3 to the length of your extension"
(s asLowercase endsWith: '.sb') ifTrue: [s _ s copyFrom: 1 to: s size - 3].

ScratchFileChooserDialog>>createScratchFileChooserFor:saving:
list _ ScratchFilePicker new extensions: #(scratch sb). "Add your extension"

I think that's everything, I just quickly look for 5 minutes. It should at least save and open correctly with the new extension  smile

For the last code, will that just make it .sR (That is my ending.)


http://dl.dropbox.com/u/9137793/Python%20Library%20logo.png
Our website: pylibrary.co.cc http://dl.dropbox.com/u/9137793/Awesomeness%20Block.gif

Offline

 

Board footer