# Right click copy power table cell value to clip board?

**URL:** <https://forum.inductiveautomation.com/t/right-click-copy-power-table-cell-value-to-clip-board/24426>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [April 26, 2019, 7:29pm UTC](https://forum.inductiveautomation.com/t/right-click-copy-power-table-cell-value-to-clip-board/24426 "2019-04-26T19:29:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 26, 2019, 7:29pm UTC](https://forum.inductiveautomation.com/t/right-click-copy-power-table-cell-value-to-clip-board/24426/1 "2019-04-26T19:29:48Z")

</div>

I have a power table. I want to make it so that right clicking a cell allows you to copy contents to your clipboard. I tried this -

```
	def copyCellToClipboard(evt, cellValue=value):
    	import os
	    command = 'echo ' + cellValue + '| clip'
	    os.system(command)
    menu = system.gui.createPopupMenu({'Copy':copyCellToClipboard})
    menu.show(event)

```

but it does not work. How can I make this work?

---

<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:** [April 29, 2019, 12:48pm UTC](https://forum.inductiveautomation.com/t/right-click-copy-power-table-cell-value-to-clip-board/24426/2 "2019-04-29T12:48:16Z")

</div>

> [@How to script Copy Paste Clipboard right mouse click](http://forum.inductiveautomation.com/t/how-to-script-copy-paste-clipboard-right-mouse-click/10277/3):
>
> The script that we use for the actual copy to clipboard is: 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.

See this post for code that works for me.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [April 29, 2019, 1:18pm UTC](https://forum.inductiveautomation.com/t/right-click-copy-power-table-cell-value-to-clip-board/24426/3 "2019-04-29T13:18:19Z")

</div>

Worked perfectly thanks!
