Clipboard
Use the Clipboard APIs to work with content from your clipboard. You can write contents to the clipboard through Clipboard.copy
and clear it through Clipboard.clear
. The Clipboard.paste
function inserts text at the current cursor position in your frontmost app.
The action Action.CopyToClipboard
can be used to copy content of a selected list item to the clipboard and the action Action.Paste
can be used to insert text in your frontmost app.
API Reference
Clipboard.copy
Copies text or a file to the clipboard.
Signature
Example
Parameters
Name | Description | Type |
---|---|---|
content* | The content to copy to the clipboard. | |
options | Options for the copy operation. |
Return
A Promise that resolves when the content is copied to the clipboard.
Clipboard.paste
Pastes text or a file to the current selection of the frontmost application.
Signature
Example
Parameters
Name | Description | Type |
---|---|---|
content* | The content to insert at the cursor. |
Return
A Promise that resolves when the content is pasted.
Clipboard.clear
Clears the current clipboard contents.
Signature
Example
Return
A Promise that resolves when the clipboard is cleared.
Clipboard.read
Reads the clipboard content as plain text, file name, or HTML.
Signature
Example
Parameters
Name | Description | Type |
---|---|---|
options | Options for the read operation. |
|
options.offset | Specify an offset to access the Clipboard History. Minimum value is 0, maximum value is 5. |
|
Return
A promise that resolves when the clipboard content was read as plain text, file name, or HTML.
Clipboard.readText
Reads the clipboard as plain text.
Signature
Example
Parameters
Name | Description | Type |
---|---|---|
options | Options for the readText operation. |
|
options.offset | Specify an offset to access the Clipboard History. Minimum value is 0, maximum value is 5. |
|
Return
A promise that resolves once the clipboard content is read as plain text.
Types
Clipboard.Content
Type of content that is copied and pasted to and from the Clipboard
Clipboard.ReadContent
Type of content that is read from the Clipboard
Clipboard.CopyOptions
Type of options passed to Clipboard.copy
.
Properties
Property | Description | Type |
---|---|---|
concealed | Indicates whether the content be treated as confidential. If |
|
Last updated