Skip to main content

Clipboard Operations

Lua Automation IDE

The following code example shows how to add text to the clipboard and then how to retrieve it. In this example we will generate a unique GUID and then retrieve that value.

Lua

-- Copy a new GUID to the clipboard
clipboard.SetText(string.guid())

-- Retrieve a GUID from the clipboard
local buf = clipboard.GetText()

-- Show the value in a message box
ui.MsgBox("Clipboard contents: " .. buf)