Table of Contents

Clipboard

This object allows you to have access to the system's clipboard. Under Linux you also have access to the selection buffer.

Functions

Clipboard

Constructor function.

Syntax

var myObject = new Clipboard();
var myObject = new Clipboard(mode);

Arguments

  1. mode - (Mode) the clipboard mode

Example

Create a Clipboard object.

var myObject = new Clipboard();

Create a Clipboard object to the selection buffer.

var myObject = new Clipboard(Clipboard.Selection);

Methods

setMode

Set the clipboard mode.

Syntax

myObject.setMode(mode);

Arguments

  1. mode - (Mode) the clipboard mode

Returns

Exceptions

setText

Sets the clipboard text.

Syntax

myObject.setText(text);

Arguments

  1. text - (string) the text to write to the clipboard

Returns

setImage

Sets the clipboard image.

Syntax

myObject.setImage(image);

Arguments

  1. image - (Image) the image to write to the clipboard

Returns

text

Returns the content of the clipboard as text.

Syntax

myObject.text();

Returns

image

Returns the content of the clipboard as an image.

Syntax

myObject.image();

Returns

dataType

Returns the current clipboard content type.

Syntax

myObject.dataType();

Returns

Attributes

text

The clipboard's content as text. (string)

image

The clipboard's content as an image. (Image)

Enumerations

Mode

Clipboard mode.

Values

  1. Standard: standard clipboard
  2. Selection: selection buffer (Linux only)
  3. FindBuffer: find buffer (Mac only)

DataType

The clipboard's data type.

Values

  1. Text: text
  2. Image: an image