Nasal library/clipboard: Difference between revisions

m
→‎getText(): Link style
m (→‎getText(): Link style)
Line 11: Line 11:
|text = Returns the contents of the clipboard as a string.
|text = Returns the contents of the clipboard as a string.
|param1 = type
|param1 = type
|param1text = Optional argument that specifies the source of the text. If <code>clipboard.CLIPBOARD</code> (the default) is given, the contents of the clipboard are returned. If <code>clipboard.SELECTION</code> is given, the contents of the selection buffer are given. Note that only X11 systems properly implement <code>clipboard.SELECTION</code>, but this argument may still be used with [[#setText()|setText()]] (see example 2).
|param1text = Optional argument that specifies the source of the text. If <code>clipboard.CLIPBOARD</code> (the default) is given, the contents of the clipboard are returned. If <code>clipboard.SELECTION</code> is given, the contents of the selection buffer are given. Note that only X11 systems properly implement <code>clipboard.SELECTION</code>, but this argument may still be used with <code>[[#setText()|setText()]]</code> (see example 2).
|example1 = var text = clipboard.getText(); # make sure you copy some text first
|example1 = var text = clipboard.getText(); # make sure you copy some text first
print("'", text, "'");
print("'", text, "'");