sys.clipboard read/write property



Get or set data from/to the Windows clipboard.

Notes

  • This property returns nil if the clipboard is empty or if the kind of data is not compatible with LuaRT.

Getting clipboard data

Getting clipboard data will return a table with the following fields :
sys.clipboard.kind sys.clipboard.content
"text" string
"files" table
(list of File and Directory)
"unknown" nil

Setting clipboard data

To set clipboard data, affect any of the following type of values to the property :
Set sys.clipboard with... Clipboard format
string text
table
(list of File and Directory)
Files/Directories
nil Empties the clipboard

Example

local clipboard = sys.clipboard if not clipboard then print("Windows clipboard is empty") else print("Clipboard contains "..clipboard.kind..":") if clipboard.kind == "files" then for entry in each(clipboard.content) do print("\t"..entry.fullpath) end sys.clipboard = nil else print("\t"..(clipboard.content or "nil")) end end