--- layout: docs title: Clipboard edit_url: "https://github.com/nylas/N1/blob/master/src/clipboard.coffee" ---

Summary

Represents the clipboard used for copying and pasting in Atom.

An instance of this class is always available as the atom.clipboard global.

Instance Methods

write(textmetadata)

Write the given text to the clipboard.

The metadata associated with the text is available by calling readWithMetadata.

Parameters
Argument Description
text

The String to store.

metadata

The additional info to associate with the text.

read()

Read the text from the clipboard.

Returns
Return Values

Returns a String.

readWithMetadata()

Read the text from the clipboard and return both the text and the associated metadata.

Returns
Return Values

Returns an Object with the following keys:

  • text The String clipboard text.
  • metadata The metadata stored by an earlier call to write.