# How to script Copy Paste Clipboard right mouse click

**URL:** <https://forum.inductiveautomation.com/t/how-to-script-copy-paste-clipboard-right-mouse-click/10277>\
**Category:** Ignition\
**Created:** [July 25, 2015, 2:44pm UTC](https://forum.inductiveautomation.com/t/how-to-script-copy-paste-clipboard-right-mouse-click/10277 "2015-07-25T14:44:03Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [July 27, 2015, 1:08pm UTC](https://forum.inductiveautomation.com/t/how-to-script-copy-paste-clipboard-right-mouse-click/10277/3 "2015-07-27T13:08:29Z")

</div>

The script that we use for the actual copy to clipboard is:

```auto
from java.awt import Toolkit
from java.awt.datatransfer import StringSelection
	
clipboard = Toolkit.getDefaultToolkit().getSystemClipboard()
clipboard.setContents(StringSelection(text_to_copy), None)

```

The script is inside a function that takes the text of the component (text\_to\_copy) as a parameter.

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-script-copy-paste-clipboard-right-mouse-click/10277)._
