Rev 39761 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{clipboard}\alias{getClipboardFormats}\alias{readClipboard}\alias{writeClipboard}\alias{clipboard}\title{Read/Write to/from the Windows Clipboard}\description{Transfer text between a character vector and the Windows clipboard.}\usage{getClipboardFormats()readClipboard(format = 1, raw = FALSE)writeClipboard(str, format = 1)}\arguments{\item{format}{an integer giving the desired format.}\item{raw}{should the value be returned as a raw vector rather than a character vector?}\item{str}{a character vector or a raw vector.}}\value{For \code{getClipboardFormats}, an integer vector of available formats.For \code{readClipboard}, a character vector by default, a raw vector if \code{raw} is\code{TRUE}, or \code{NULL}, if the format is unavailable.For \code{writeClipboard} an invisible logical indicating success or failure.}\details{The Windows clipboard offers data in a number of formats. The standard formats are\tabular{lr}{CF\_TEXT \tab 1 \crCF\_BITMAP \tab 2 \crCF\_METAFILEPICT \tab 3 \crCF\_SYLK \tab 4 \crCF\_DIF \tab 5 \crCF\_TIFF \tab 6 \crCF\_OEMTEXT \tab 7 \crCF\_DIB \tab 8 \crCF\_PALETTE \tab 9 \crCF\_PENDATA \tab 10 \crCF\_RIFF \tab 11 \crCF\_WAVE \tab 12 \crCF\_UNICODETEXT \tab 13 \crCF\_ENHMETAFILE \tab 14 \crCF\_HDROP \tab 15 \crCF\_LOCALE \tab 16 \crCF\_MAX \tab 17 \crCF\_OWNERDISPLAY \tab 128 \crCF\_DSPTEXT \tab 129 \crCF\_DSPBITMAP \tab 130 \crCF\_DSPMETAFILEPICT \tab 131 \crCF\_DSPENHMETAFILE \tab 142 \crCF\_PRIVATEFIRST \tab 512 \crCF\_PRIVATELAST \tab 767 \crCF\_GDIOBJFIRST \tab 768 \crCF\_GDIOBJLAST \tab 1023 \cr}Applications normally make data available in one or more of these and possibly additional privateformats. Use \code{raw=TRUE} to read binary formats, \code{raw=FALSE} (the default)for text formats.The \code{writeClipboard} function will write a character vector as text, with standardCR-LF line terminators. It will copy a raw vector directly to the clipboard without any changes.}\seealso{\code{\link{file}} which can be used to set up a connection to a clipboard.}\keyword{utilities}