Hello everyone, I am currently making a app lab drawing program V.2 that includes a save/load instructions area, the code fully works, but i was wondeing if there is a way i could make a button that the user clicks to save the instructions in their clipboard without them having to go into the save text area and cmd+c the text to save users some time. I currenly couldent find a way and I think the clipboard api is not supported in app lab, is this true or am I wrong?
Link to the project or level: App Lab - Code.org
What I expect to happen: Able to copy text into users clipboard with their clipbaord premmision.
What actually happens: I dont think a clipbaord button works, currenly i havent added a button into the main v.2, but I did make a demo project that failed.
What I’ve tried: Chatgpt
Greetings @milannikulin
From my knowledge it is currently not possible with the current way of how Applab is sandboxing elements and native js which has no way of running native clipboard API commands. Likely you would need Dom or Navigator access of which you likely wont get
Originally in Gamelab you were able to dump file downloads but that has since been patched out due to security concerns (from what ive heard)
So likely the best thing you can do is prompt the user to ctrl c with a prompt function so that they are actively notified that they have not saved their work and need it in their clipboard to save later
1 Like
It is still possible to export a proper save file though, which this project is able to do by utilizing the export_csv call App Lab - Code.org which you can use as a pseudo clipboard but this is likely the closest you’ll get
1 Like