The framework offers a
// Note: displays its own toast, confirming that the copy has happened
Framework.CopyTextToClipboard("My text");
Two things in particular to note about this function:
Widgets cannot use the normal
Scripts and UDIs can use this function. They would not otherwise be able to access the clipboard because of not being documents and having no