====== 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 === - mode - ([[#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 === - mode - ([[#mode|Mode]]) the clipboard mode === Returns === * (Clipboard) this Clipboard === Exceptions === * (UnsupportedSelectionModeError) this mode is not supported under this operating system ==== setText ==== Sets the clipboard text. === Syntax === myObject.setText(text); === Arguments === - text - (string) the text to write to the clipboard === Returns === * (Clipboard) this Clipboard ==== setImage ==== Sets the clipboard image. === Syntax === myObject.setImage(image); === Arguments === - image - ([[en:code:core:image|Image]]) the image to write to the clipboard === Returns === * (Clipboard) this Clipboard ==== text ==== Returns the content of the clipboard as text. === Syntax === myObject.text(); === Returns === * (string) the content of the clipboard as text ==== image ==== Returns the content of the clipboard as an image. === Syntax === myObject.image(); === Returns === * ([[en:code:core:image|Image]]) the content of the clipboard as an image ==== dataType ==== Returns the current clipboard content type. === Syntax === myObject.dataType(); === Returns === * ([[#datatype|DataType]]) the current clipboard content type ===== Attributes ===== ==== text ==== The clipboard's content as text. (string) ==== image ==== The clipboard's content as an image. ([[en:code:core:image|Image]]) ===== Enumerations ===== ==== Mode ==== Clipboard mode. === Values === - Standard: standard clipboard - Selection: selection buffer (Linux only) - FindBuffer: find buffer (Mac only) ==== DataType ==== The clipboard's data type. === Values === - Text: text - Image: an image