Discuss Scratch
- Discussion Forums
- » Developing Scratch Extensions
- » My Scratch Extension
- donotforgetmycode
- Scratcher
1000+ posts
My Scratch Extension
How to link to another website on Scratch
Step 1:
Highlight the code below and press Ctrl+C or right-click and select Copy.
Step 2:
Go to Scratch and press Ctrl+Shift+J.
Press Ctrl+V or right-click and select Paste.
Step 3:
Click More Blocks. You should see this block:
Step 1:
Highlight the code below and press Ctrl+C or right-click and select Copy.
(function(ext) {
// Cleanup function when the extension is unloaded
ext._shutdown = function() {};
// Status reporting code
// Use this to report missing hardware, plugin or unsupported browser
ext._getStatus = function() {
return {status: 2, msg: 'Ready'};
};
ext.my_first_block = function(website) {
window.location.href = website;
};
// Block and block menu descriptions
var descriptor = {
blocks: [
// Block type, block name, function name
[' ', 'link to %s', 'my_first_block', 'https://scratch.mit.edu'],
]
};
// Register the extension
ScratchExtensions.register('Link', descriptor, ext);
})({});
Go to Scratch and press Ctrl+Shift+J.
Press Ctrl+V or right-click and select Paste.
Step 3:
Click More Blocks. You should see this block:
link to [https://scratch.mit.edu]Use the block!
This text under the grey line is my signature. It's not part of my post, but it automatically shows up under all of my posts.
I recommend reading jvvg and Sliverus's essays.
She/her
Stuff at the bottom of my signature:
for \({https://scratch.mit.edu/discuss/post/6785965/
set [i v] to [0]
}; <(i) < [10]>; {
change [i v] by (1)
}) \{{
think (i) for (1) secs
}} :: control
Would you recommend a confirmation dialog box on that action?
________________________________
| Really send missiles? (Y)es (N)o |
——————————————————
Please forgive my crude mock-up.
By the way - this is rejected for safety reasons.
a bully with a big belly steals your moist cheesy beefmusic origins
Be horizontal —
(thanks @thugatwoary and @Za-Chary)
Be high contrast
Generation -1: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and decrease the generation by 1. Social experiment.
i ran out of characters
Kumquat lore
The Scratch Forums support bf +-<>[],.
It seems I can still use assets in my signature. test:
;
- donotforgetmycode
- Scratcher
1000+ posts
My Scratch Extension
Oops, sorry Wrong forum…………………..
My I teach you about /discuss/48?
https://scratch.mit.edu/discuss/48/
I think it has been moved though.
Last edited by donotforgetmycode (Aug. 15, 2017 08:26:09)
This text under the grey line is my signature. It's not part of my post, but it automatically shows up under all of my posts.
I recommend reading jvvg and Sliverus's essays.
She/her
Stuff at the bottom of my signature:
for \({https://scratch.mit.edu/discuss/post/6785965/
set [i v] to [0]
}; <(i) < [10]>; {
change [i v] by (1)
}) \{{
think (i) for (1) secs
}} :: control
Would you recommend a confirmation dialog box on that action?
________________________________
| Really send missiles? (Y)es (N)o |
——————————————————
Please forgive my crude mock-up.
By the way - this is rejected for safety reasons.
a bully with a big belly steals your moist cheesy beefmusic origins
Be horizontal —
(thanks @thugatwoary and @Za-Chary)
Be high contrast
Generation -1: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and decrease the generation by 1. Social experiment.
i ran out of characters
Kumquat lore
The Scratch Forums support bf +-<>[],.
It seems I can still use assets in my signature. test:
;
- JGames101
- Scratcher
100+ posts
My Scratch Extension
How to link to another website on ScratchThis is great! I remember my first extension was just true and false blocks…
Step 1:
Highlight the code below and press Ctrl+C or right-click and select Copy.Step 2:(function(ext) {
// Cleanup function when the extension is unloaded
ext._shutdown = function() {};
// Status reporting code
// Use this to report missing hardware, plugin or unsupported browser
ext._getStatus = function() {
return {status: 2, msg: 'Ready'};
};
ext.my_first_block = function(website) {
window.location.href = website;
};
// Block and block menu descriptions
var descriptor = {
blocks: [
// Block type, block name, function name
[' ', 'link to %s', 'my_first_block', 'https://scratch.mit.edu'],
]
};
// Register the extension
ScratchExtensions.register('Link', descriptor, ext);
})({});
Go to Scratch and press Ctrl+Shift+J.
Press Ctrl+V or right-click and select Paste.
Step 3:
Click More Blocks. You should see this block:link to [https://scratch.mit.edu]Use the block!
Here are a few tips for your forum post, though:
instead of having your block look like
link to [https://scratch.mit.edu]
link to [https://scratch.mit.edu]
link to [https://scratch.mit.edu] :: extension
link to [https://scratch.mit.edu] :: extension
Another thing you can do is instead of using
[code]
[/code]
[code=javascript]
[/code]
(function(ext) { // Cleanup function when the extension is unloaded ext._shutdown = function() {}; // Status reporting code // Use this to report missing hardware, plugin or unsupported browser ext._getStatus = function() { return {status: 2, msg: 'Ready'}; }; ext.my_first_block = function(website) { window.location.href = website; }; // Block and block menu descriptions var descriptor = { blocks: [ // Block type, block name, function name [' ', 'link to %s', 'my_first_block', 'https://scratch.mit.edu'], ] }; // Register the extension ScratchExtensions.register('Link', descriptor, ext); })({});
- donotforgetmycode
- Scratcher
1000+ posts
My Scratch Extension
Thank you This is great! I remember my first extension was just true and false blocks…
Here are a few tips for your forum post, though:
instead of having your block look likelink to [https://scratch.mit.edu]You can dolink to [https://scratch.mit.edu]link to [https://scratch.mit.edu] :: extensionJust to make it look betterlink to [https://scratch.mit.edu] :: extension
Another thing you can do is instead of usingYou can do[code]
[/code]And instead of being all grey, it makes the text look like[code=javascript]
[/code]So it's easier to understand. Anyway, great extension, and I look forward to seeing what you create in the future(function(ext) { // Cleanup function when the extension is unloaded ext._shutdown = function() {}; // Status reporting code // Use this to report missing hardware, plugin or unsupported browser ext._getStatus = function() { return {status: 2, msg: 'Ready'}; }; ext.my_first_block = function(website) { window.location.href = website; }; // Block and block menu descriptions var descriptor = { blocks: [ // Block type, block name, function name [' ', 'link to %s', 'my_first_block', 'https://scratch.mit.edu'], ] }; // Register the extension ScratchExtensions.register('Link', descriptor, ext); })({});
Last edited by donotforgetmycode (Aug. 20, 2017 12:55:34)
This text under the grey line is my signature. It's not part of my post, but it automatically shows up under all of my posts.
I recommend reading jvvg and Sliverus's essays.
She/her
Stuff at the bottom of my signature:
for \({https://scratch.mit.edu/discuss/post/6785965/
set [i v] to [0]
}; <(i) < [10]>; {
change [i v] by (1)
}) \{{
think (i) for (1) secs
}} :: control
Would you recommend a confirmation dialog box on that action?
________________________________
| Really send missiles? (Y)es (N)o |
——————————————————
Please forgive my crude mock-up.
By the way - this is rejected for safety reasons.
a bully with a big belly steals your moist cheesy beefmusic origins
Be horizontal —
(thanks @thugatwoary and @Za-Chary)
Be high contrast
Generation -1: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and decrease the generation by 1. Social experiment.
i ran out of characters
Kumquat lore
The Scratch Forums support bf +-<>[],.
It seems I can still use assets in my signature. test:
;
- jackkillian
- Scratcher
24 posts
My Scratch Extension
You said go to Scratch and press Control+Shift+J.
The Scratch homepage or the Scratch project editor.
The Scratch homepage or the Scratch project editor.
Last edited by jackkillian on March 9, 9999
#Bring_it_Back
Hi, and welcome to Scratch! Click Here to go to the Scratch home page.
- jackkillian
- Scratcher
24 posts
My Scratch Extension
My browser / operating system: MacOS Macintosh X 10.12.5, Chrome 60.0.3112.101, Flash 26.0 (release 0)
Not working for me on either.
Not working for me on either.
Last edited by jackkillian on March 9, 9999
#Bring_it_Back
Hi, and welcome to Scratch! Click Here to go to the Scratch home page.
- donotforgetmycode
- Scratcher
1000+ posts
My Scratch Extension
Try holding cmd instead of ctrl in the project editor. Do not do anything on the editor, otherwise the JavaScript console will not appear. ☺ My browser / operating system: MacOS Macintosh X 10.12.5, Chrome 60.0.3112.101, Flash 26.0 (release 0)
Not working for me on either.
This text under the grey line is my signature. It's not part of my post, but it automatically shows up under all of my posts.
I recommend reading jvvg and Sliverus's essays.
She/her
Stuff at the bottom of my signature:
for \({https://scratch.mit.edu/discuss/post/6785965/
set [i v] to [0]
}; <(i) < [10]>; {
change [i v] by (1)
}) \{{
think (i) for (1) secs
}} :: control
Would you recommend a confirmation dialog box on that action?
________________________________
| Really send missiles? (Y)es (N)o |
——————————————————
Please forgive my crude mock-up.
By the way - this is rejected for safety reasons.
a bully with a big belly steals your moist cheesy beefmusic origins
Be horizontal —
(thanks @thugatwoary and @Za-Chary)
Be high contrast
Generation -1: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and decrease the generation by 1. Social experiment.
i ran out of characters
Kumquat lore
The Scratch Forums support bf +-<>[],.
It seems I can still use assets in my signature. test:
;
- donotforgetmycode
- Scratcher
1000+ posts
My Scratch Extension
bump
This text under the grey line is my signature. It's not part of my post, but it automatically shows up under all of my posts.
I recommend reading jvvg and Sliverus's essays.
She/her
Stuff at the bottom of my signature:
for \({https://scratch.mit.edu/discuss/post/6785965/
set [i v] to [0]
}; <(i) < [10]>; {
change [i v] by (1)
}) \{{
think (i) for (1) secs
}} :: control
Would you recommend a confirmation dialog box on that action?
________________________________
| Really send missiles? (Y)es (N)o |
——————————————————
Please forgive my crude mock-up.
By the way - this is rejected for safety reasons.
a bully with a big belly steals your moist cheesy beefmusic origins
Be horizontal —
(thanks @thugatwoary and @Za-Chary)
Be high contrast
Generation -1: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and decrease the generation by 1. Social experiment.
i ran out of characters
Kumquat lore
The Scratch Forums support bf +-<>[],.
It seems I can still use assets in my signature. test:
;
- Monkeymono2019
- Scratcher
21 posts
My Scratch Extension
define (yourself v)This is a test
Wanna check out my profile? Go here!
- exa_lyrua
- Scratcher
16 posts
My Scratch Extension
how to help me pls !?
(Help to)
switch costume to [coins (no i'am not give coins)]
- exa_lyrua
- Scratcher
16 posts
My Scratch Extension
its not workingThank you This is great! I remember my first extension was just true and false blocks…
Here are a few tips for your forum post, though:
instead of having your block look likelink to [https://scratch.mit.edu]You can dolink to [https://scratch.mit.edu]link to [https://scratch.mit.edu] :: extensionJust to make it look betterlink to [https://scratch.mit.edu] :: extension
Another thing you can do is instead of usingYou can do[code]
[/code]And instead of being all grey, it makes the text look like[code=javascript]
[/code]So it's easier to understand. Anyway, great extension, and I look forward to seeing what you create in the future(function(ext) { // Cleanup function when the extension is unloaded ext._shutdown = function() {}; // Status reporting code // Use this to report missing hardware, plugin or unsupported browser ext._getStatus = function() { return {status: 2, msg: 'Ready'}; }; ext.my_first_block = function(website) { window.location.href = website; }; // Block and block menu descriptions var descriptor = { blocks: [ // Block type, block name, function name [' ', 'link to %s', 'my_first_block', 'https://scratch.mit.edu'], ] }; // Register the extension ScratchExtensions.register('Link', descriptor, ext); })({});
- donotforgetmycode
- Scratcher
1000+ posts
My Scratch Extension
This only worked on Scratch 2.0.
This text under the grey line is my signature. It's not part of my post, but it automatically shows up under all of my posts.
I recommend reading jvvg and Sliverus's essays.
She/her
Stuff at the bottom of my signature:
for \({https://scratch.mit.edu/discuss/post/6785965/
set [i v] to [0]
}; <(i) < [10]>; {
change [i v] by (1)
}) \{{
think (i) for (1) secs
}} :: control
Would you recommend a confirmation dialog box on that action?
________________________________
| Really send missiles? (Y)es (N)o |
——————————————————
Please forgive my crude mock-up.
By the way - this is rejected for safety reasons.
a bully with a big belly steals your moist cheesy beefmusic origins
Be horizontal —
(thanks @thugatwoary and @Za-Chary)
Be high contrast
Generation -1: The first time you see this, copy and paste it on top of your signature in the Scratch forums, and decrease the generation by 1. Social experiment.
i ran out of characters
Kumquat lore
The Scratch Forums support bf +-<>[],.
It seems I can still use assets in my signature. test:
;
- Discussion Forums
- » Developing Scratch Extensions
- » My Scratch Extension