So this is why I developed this plug-in. It is a dynamic action plug-in that you can use in any DA, but usually it will be a DA fired from a button. It is used in the page to generate substitution code:
Implementing this functionality is as easy as importing the plug-in and call it in the dynamic action behind the click on the button. Select the item of which the content should be copied and you are off to go:
You can see this plug-in in action on the demo page for this plug-in.
You can find the plug-in on apex.world.
Source Article from http://dickdral.blogspot.com/2017/01/plug-in-for-copying-to-clipboard.html