clipboard Module
Read and write plain text in the Windows clipboard from Novadesk.
The clipboard module is exported from the system module.
javascript
import { clipboard } from "system";Table of Contents
clipboard.getText()
Gets the current clipboard text.
Return Value
- Type:
string - Description: Clipboard text. Returns an empty string (
"") when text is unavailable.
clipboard.setText(text)
Sets clipboard text.
Parameters
text- Type:
string - Description: Text to write to the clipboard.
- Type:
Return Value
- Type:
boolean - Description:
trueif clipboard text was updated; otherwisefalse.
Example
javascript
import { clipboard } from "system";
const ok = clipboard.setText("Copied from Novadesk");
console.log("setText:", ok);
const value = clipboard.getText();
console.log("clipboard:", value);