This script is pretty self explanatory. Pass a string to the copyToClipboard function and it will be placed into the clipboard so you can paste it into other programs.
I've put the script into the text area below to make it easy to get. Just click the 'Copy To Clipboard' button and the contents of the text area below will be sent to the clipboard.
The code for the example above looks like...
Mozilla based browsers will ask the user for permission before allowing this script to access the clipboard.