Kitcat 1.3 is in the works, and I want to change the file extension for it (currently .sb). Don't be smart about this and give me the wrong stuff on how to change the file type from .sb to .sb.blahblahblah, I want to know how to make it change from .sb to .kct NOT .sb.kct (I don't like it) so HELP!!!!
Offline
go to a folder, any folder and click on the tools and then folder options. go to view and unchec something about hiding the extension then click apply to all folders then change the extension by renaming it.
Offline
i found a thing in the browser a few weeks ago to change it, but im not using my laptop so i can't get on to it right now
Offline
found it!
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"
Credit to wcfs96 for that.
Offline
nathanprocks wrote:
found it!
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"Credit to wcfs96 for that.
I tried it and it makes .sb.kct instead of .kct
Offline
GP1 wrote:
Kitcat 1.3 is in the works, and I want to change the file extension for it (currently .sb). Don't be smart about this and give me the wrong stuff on how to change the file type from .sb to .sb.blahblahblah, I want to know how to make it change from .sb to .kct NOT .sb.kct (I don't like it) so HELP!!!!
There used to be a thread like this somewhere that I posted on... I'll try to get it from the midst of my post archive cause I answered it.
EDIT: I decided to be nice and not make you click any links
EDIT2: I'm not sure if this works though
I never got around to testing
SJRCS_011 wrote:
Scratch-UI-Panes --> ScratchFrameMorph --> Instance --> file read/write -->
importScratchProjectCode:
extensions: #(scratch sb kct)nameFromFileName: fileName: add line
Code:
(s asLowercase endsWith: '.kct' ifTrue: [s _ s copyFrom: 1 to s size - 3].saveScratchProject: change
Code:
fName _ (self nameFromFileName: fName), '.sb'.to
Code:
fName _ (self nameFromFileName: fName), '.kct'.saveScratchProjectNoDialog: change '.sb' on line 9 and 15 to '.kct'
Last edited by SJRCS_011 (2012-05-16 16:11:32)
Offline
SJRCS_011 wrote:
Scratch-UI-Panes --> ScratchFrameMorph --> Instance --> file read/write -->
importScratchProjectCode:
extensions: #(scratch sb kct)nameFromFileName: fileName: add line
Code:
(s asLowercase endsWith: '.kct' ifTrue: [s _ s copyFrom: 1 to s size - 3].saveScratchProject: change
Code:
fName _ (self nameFromFileName: fName), '.sb'.to
Code:
fName _ (self nameFromFileName: fName), '.kct'.saveScratchProjectNoDialog: change '.sb' on line 9 and 15 to '.kct'
Hmm... that lets you save but not open custom extension projects.
Offline