Read text from clipboard.

read_clipboard(which = "tcltk")

read_clipboard_clipr()

read_clipboard_tcltk()

Arguments

which

(string) either "tcltk" or "clipr".

Value

  • read_clipboard() and read_clipboard_tcltk() return a string from clipboard. If the clipboard contains non-sting object, empty sting ("") is returned.

Details

  • read_clipboard_clipr() uses clipr implementation. Encoding issues may occur on Windows.

  • read_clipboard_tcltk() uses Tcl/Tk implementation of clipboard. Tcl/Tk clipboard gets empty, if is window gets closed.

The functions in all cases must return a single string. Possible different conditions on clipboard:

  • one line of text;

  • several lines of text;

  • non-text object.

Examples