IronPython: copy to clipboard in Web Player

I've got a requirement to copy some text to the clipboard when an action control (button) is clicked in Spotfire.  I've got it working in the desktop version of Analyst, but I get this error when I try to execute the script in the Web Player:

Could not execute script 'myScript': Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.

My IronPython code looks like this:

import clr
from System.Windows.Forms import Clipboard
theText = "some text goes here"

Is there a way to get this functionality (or something equivalent) to work in the Web Player?



West Texas Analytics, LLC

(2) Answers