Adding Text to a User's Clipboard

Hi! I've been working on a project, and would like to know if there's an easy way to add something to the clipboard of a user's clipboard, so they can paste it elsewhere. I found a way to do this on the forum, however, it requires Javascript extensions, which I really want to avoid. Is there any way to do this without Javascript?

You could do what they always do in Scratch: Have the user copy the text from a list. See this project for an example. You can show/hide the variable when you want.

Yes, I was aware of that. I was more looking for a way for the code itself to copy something to the user's clipboard without the user having to copy it manually.

You can only do it with javascript (I'm pretty sure there's no whitelisted extension that does it). If you want the blocks, I have them: Snap! Build Your Own Blocks

I don't think there is a way except for JS, which requires the user to go into the project manually, so honestly copying from a list would just be faster.

... unless you want to do it more than once.

Okay, thanks for letting me know. I'll just use the list method.

What sort of project you are trying to make? How do you present the text you want viewers to copy? Depending on the project, you might want to present text differently.

Basically this is just going to give the user a code that they can send to others, or keep for themselves, to share creations. (I'm trying to give as much detail without really explaining exactly what, as it's going to be a bit of a surprise.)

I use extension [txt_export(txt, name) V] [] @delInput @verticalEllipsis @addInput for this.

But that saves a text file, which people may not want.

They don't want it to save in the filesystem or they don't want the file extension?

They may not want to save a file.

I just had needed to save text (the same as highlighting and copying something) so the user can paste it elsewhere. I kind of wanted to avoid using a list display, as it can be a little weird especially with those not changing size with the stage when the user enters full screen, but I can make it work.

I assume you don't want to use JavaScript, but if you are fine with it, you can use the writeText method of navigator.clipboard to save text to the clipdoard, I.E.

navigator.clipboard.writeText("The text to be copied.")

Edit:nevermind

Read: