There is actually already a function for this, but its locked to core scripts. (it’s used in toolbox)
As an alternative to a click to copy button, replace the text label with a text box with TextEditable set to false. The player will then be able to copy the text, albeit with a few more steps (click, ctrl+a, ctrl+c).
If this were to be given to normal context scripts, there should probably be a length limit. (so you can’t copy gigabytes of text onto the clipboard)
Definitely something we need the ability to do! But somehow my gut tells me there’s a reason it hasn’t been approved.
(Abusing the clipboard system in a way that could let users put malicious urls in their clipboards and telling the user to CTRL + V into the search bar and pressing enter would definitely be bad)
It could be prone to spamming, and even with a rate limit, receiving a pop-up notification every 60 seconds or more would be really annoying.
Despite the pop-up notification, many children may simply click randomly to dismiss it and continue playing their games.
However, implementing this feature would be beneficial for plugins, the core script requirement would be lowered to plugin security,
a pop-up and something similar to Chrome’s pop-up security could be used so that plugins cannot prompt users without clicking on a button.
Edit: I didn’t realize this was 3 years ago lol but as far as I know it still isn’t implemented
If a game is misusing the API in a way that causes it to constantly pop up, then the game is poorly designed, not the API. Something very similar to this is how pop-ups for purchasing things ingame works: if the game abuses it and constantly tells you to buy something, you will get frustrated and leave. That’s the dev’s fault, not MarketplaceService’s fault.
A bad (or malicious) game dev can already do far worse than make a popup on your screen asking you to copy some text; that shouldn’t be a reason as to why this can’t be implemented.
I think if such an API was made available, it should be a one-time prompt per experience/plugin, or perhaps per-session for experiences.
However, I don’t believe there’s much benefit to experiences having access to the clipboard, but definitely would be useful to plugins, so I would be fine with a clipboard API being restricted to PluginSecurity.
I thought it would be useful because of things like copying an instance into the clipboard or having a plugin that copies the full path of the currently selected instance for scripting. Maybe there could even be a ‘copy terrain’ plugin that allows you to easily copy terrain to a different game. The benefits I listed would save time, and the code is already there. They just need to lower the security level for plugins. I had the same idea of a simple permission when the plugin tries to access the clipboard API at first, but what the plugin is copying matters. If the plugin suddenly copies a phishing link instead of a Roblox link, for example, there wouldn’t be a pop-up and a developer may go to the link without noticing it changing. However, with plugins by verified creators being the default option in the toolbox and developers being more conscious than the average player, a simple permission system may still be useful.
Still require a strong need for this API. When testing huge swaths of data, there’s no real easy to copy all the strings contents outside of the roblox engine to read it in a text filer reader like notepad. This would be very very useful to be able to extract strings for reading.