Clipboard
Description
Represents the clipboard used for copying and pasting in Pulsar.
An instance of this class is always available as the atom.clipboard global.
Examples
atom.clipboard.write('hello')
console.log(atom.clipboard.read()) // 'hello'
API documentation
All methods
::write(text, metadata)
Write the given text to the clipboard.
The metadata associated with the text is available by calling Clipboard::readWithMetadata.
| Argument | Description |
|---|---|
text
|
The String to store. |
metadata
|
optional
The additional info to associate with the text. |
::read()
Read the text from the clipboard.
Return values
-
Returns a String.
::writeFindText()
Write the given text to the macOS find pasteboard
::readFindText()
Read the text from the macOS find pasteboard.
Return values
-
Returns a String.
::readWithMetadata()
Read the text from the clipboard and return both the text and the associated metadata.
Return values
-
Returns an Object with the following keys:
textThe String clipboard text.metadataThe metadata stored by an earlier call to Clipboard::write.