NOTE: As of July 12, 2009, this blog has been discontinued and replaced by the new Thought Delimited blog. All of the entries in this blog can be found there, along with new posts.
How to Copy To and From the Clipboard using JavaScript in AIR Beta 2
Getting text from the clipboard:
alert("ctext is: " + ctext);
Clearing the clipboard:
Sending text to the clipboard:
var clip= air.Clipboard.generalClipboard;
clip.setData("air:text",myText,false);
The functions involved are all covered in the JavaScript Language Reference for Adobe AIR, but I found the documentation less than clear, and all the examples I found in blog posts and in the Adobe forums were from earlier versions of AIR/Apollo. Even the PDF documentation that came with the AIR download was out-of-date (note to Adobe: that's not good).
This example only covers text, but it should provide enough of a guide so that, along with the language reference, you can work with other data types.
Update: the clipboard functions listed above also seem to work unchanged in AIR Beta 3

