Topic Information

copy to clipboard/copy block by Abitofevrything in Suggestions

Posts: 38

1: Abitofevrything wrote at 2:33:20 PM 26/4/20193523126
It would be nice if scratch had some block which would allow the code to "auto-copy something'. What I mean is if you could have a block resembling this : which, when triggered would perform the action of highliting the <text here> and performing ctrl+c / cmd+v, without the user having to manually copy it.
This could help in projects which can give a save code, so when you need the save code, you would not have to have a list with an item that you copy, but an automatically copied save code, that the user could the paste somewhere else.

TL;DR :adding a copy block is a good idea

Sorry for any mistakes, I'm writing this on mobile
2: -Accio- wrote at 10:02:08 PM 26/4/20193523577
Weak Support

While this could be useful in the circumstance you said, that circumstance is pretty specific, and there aren't many other times when this would be useful. Also, this could have the (although small) possibility for private messaging, using something like the script below.

when green flag clicked
if <(username) = [-Accio-]> then
copy [Private Message] to clipboard::control
end
3: LuckyLucky7 wrote at 11:03:51 AM 27/4/20193524090
No support, you could just use another list as a clipboard. If that block was implemented and then a Scratcher wanted to paste something into another website(or the forums and comments sections that are in Scratch), they would see something that they did not copy to their clipboard, and that would make the Scratcher confused and disappointed at the fact that they will have to go back where what they wanted to copy was from, and then go back to that website.
4: HpInkJet wrote at 1:30:21 PM 15/11/20193758831

Morimop wrote:

C0nyc0n wrote:

This would only work if the tab is open, there would be a warning before launching the project (like the ‘username’ block) and there would be a popup that would be toggleable in account settings (on by default).
About bold part: I think it's kinda impossible. Think if you make it: “copy everything to board without permission”
Maybe these can happen:

oxiti8 wrote:

The problem I see with that is what people could use it for… Say someone had an important thing on their clipboard: someone could just have that run in the background to delete that file.
Also inappropriate things. Maybe.


I agree mate this could be used in some pretty harmful ways. I love the idea though.
5: apple502j wrote at 3:43:55 PM 15/11/20193758904

C0nyc0n wrote:

apple502j wrote:

No. The popup must be clicked each time before clipboard is used. You can't do that before green flag because project is not running.
That's how the popup would work, it would appear every time the block runs
Then it would be used to make stop button unclickable y forever setting clipbard
6: Abitofevrything wrote at 10:21:40 AM 17/11/20193760320
Maybe there cold be an alert "copy text to clipboard?" that way there would be user interaction

n.b for y'all coders out there, by an alert I mean a confirm();
7: apple502j wrote at 5:10:56 PM 17/11/20193760545
confirm() does not give permission to use clipboard iirc.
8: DoNotFoIIowMe wrote at 6:17:47 PM 19/11/20193762229
Maybe I'm just stupid, but how do you connect Scratch programs with your local clipboard? I feel like there's no JS option for that.
9: apple502j wrote at 2:57:30 AM 20/11/20193762609
There are a few ways, Clipboard API or document.execCommand. Both must be fired inside onclick event.
10: DoNotFoIIowMe wrote at 10:52:16 AM 20/11/20193762773

apple502j wrote:

There are a few ways, Clipboard API or document.execCommand. Both must be fired inside onclick event.

I see, thank you for explaining. The issue is, don't document codes overwrite all <p> tags?
11: Jaden0912 wrote at 11:47:18 PM 20/11/20193763282

-Accio- wrote:

Weak Support

While this could be useful in the circumstance you said, that circumstance is pretty specific, and there aren't many other times when this would be useful. Also, this could have the (although small) possibility for private messaging, using something like the script below.

when green flag clicked
if <(username) = [-Accio-]> then
copy [Private Message] to clipboard::control
end
forever if <> 

end::control
12: Jaden0912 wrote at 11:48:58 PM 20/11/20193763284
repeat () if::control

end
13: Harakou wrote at 7:50:22 AM 29/6/20204172658
Merged two other threads about this idea.
14: HTML-Fan wrote at 9:04:05 AM 29/6/20204172851
Ok, thank you!
15: HTML-Fan wrote at 10:21:47 AM 29/6/20204173044

HTML-Fan wrote:

(I made a topic with multiple questions, here's one of them, that's why it may sound out of context)
Annoying is also that you have to use
show list [ v]
and
ask [] and wait
for level codes because there are no blocks for copy and paste. Blocks like
set clipboard to [] :: variables
When pasted (clipboard :: events) :: events :: hat
would be useful.

So, what do you think about my suggestions? I don't see any disadvanteges (besides crappy projects which set your clipboard to **** *** ** ****** ***!, but you could make a warning there), but I don't know what JavaScript thinks about my ideas.

You must confirm that you want something on your clipboard.
I thought about this and now I have a new idea:
Instead of
set clipboard to [] :: variables
there should be
when copied (set clipboard to [] :: events :: stack) :: hat :: events
, an event that is triggered when you press ctrl+c, so there are no pranks possible. You can only set the clipboard when ctrl+c is pressed.
16: HTML-Fan wrote at 1:52:03 PM 29/6/20204173537
*bump*
17: HTML-Fan wrote at 3:38:57 PM 29/6/20204173900
*bump*
18: HTML-Fan wrote at 5:06:28 PM 29/6/20204174235
*bump*
19: HTML-Fan wrote at 6:26:24 PM 29/6/20204174479
*gettingtiredfrombumpingandseeingbumps*
20: xXRedTheCoderXx wrote at 7:24:13 PM 29/6/20204174696

HTML-Fan wrote:

*gettingtiredfrombumpingandseeingbumps*
In that case, please, please, please stop bumping the second your topic gets on the second page. Your topics are clogging up the first page, giving other topics less attention than they need.

Only bump every 24 hours so other topics can get the attention they deserve, and one bump a day is good enough anyway.