WOLFRAM

replaces the contents of the clipboard with expr.

Details

  • The expression expr is evaluated and typeset before being copied to the clipboard. To copy a textual form, specify a string or InputForm[expr].
  • CopyToClipboard[Defer[expr]] copies the unevaluated form of expr.
  • CopyToClipboard["string"] copies the contents of "string" as plain text.
  • The expression expr can be any expression, including those that represent notebooks or cells.
  • CopyToClipboard supports typeset expressions, such as StandardForm and TraditionalForm.
  • When pasted in between cells, the results of CopyToClipboard will be at the highest fidelity. Style or formatting information may be lost when pasting into an existing cell or when pasting into an application other than the Wolfram System.

Examples

open allclose all

Basic Examples  (4)Summary of the most common use cases

Copy a simple expression to the clipboard:

Out[1]=1

Use Defer to copy an unevaluated form of the expression:

Out[1]=1

Copy the StandardForm representation of an expression:

Out[1]=1

Copy the InputForm representation of an expression:

Scope  (3)Survey of the scope of standard use cases

Copying a string copies the contents of the string:

a+b

Copy a graphic:

Out[1]=1

Copy an interface:

Out[1]=1

Generalizations & Extensions  (2)Generalized and extended use cases

A series of discrete cells can be copied by using DocumentNotebook:

onetwo

Copied cells preserve any specified style information:

Applications  (2)Sample problems that can be solved with this function

Create a button to copy the contents of an interface:

Out[1]=1

Pick a point and copy its coordinates:

Out[1]=1

Properties & Relations  (1)Properties of the function, and connections to other functions

Copying a cell expression preserves that expression exactly on the clipboard:

Out[1]=1

Possible Issues  (2)Common pitfalls and unexpected behavior

Evaluation of expressions can have unexpected effects such as reordering the copied result:

Out[1]=1

All such effects can be prevented using Defer:

Out[2]=2

When CopyToClipboard receives a string with embedded typesetting, it is copied using linear form:

Wolfram Research (2010), CopyToClipboard, Wolfram Language function, https://reference.wolfram.com/language/ref/CopyToClipboard.html.
Wolfram Research (2010), CopyToClipboard, Wolfram Language function, https://reference.wolfram.com/language/ref/CopyToClipboard.html.

Text

Wolfram Research (2010), CopyToClipboard, Wolfram Language function, https://reference.wolfram.com/language/ref/CopyToClipboard.html.

Wolfram Research (2010), CopyToClipboard, Wolfram Language function, https://reference.wolfram.com/language/ref/CopyToClipboard.html.

CMS

Wolfram Language. 2010. "CopyToClipboard." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CopyToClipboard.html.

Wolfram Language. 2010. "CopyToClipboard." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CopyToClipboard.html.

APA

Wolfram Language. (2010). CopyToClipboard. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CopyToClipboard.html

Wolfram Language. (2010). CopyToClipboard. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CopyToClipboard.html

BibTeX

@misc{reference.wolfram_2025_copytoclipboard, author="Wolfram Research", title="{CopyToClipboard}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/CopyToClipboard.html}", note=[Accessed: 16-April-2025 ]}

@misc{reference.wolfram_2025_copytoclipboard, author="Wolfram Research", title="{CopyToClipboard}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/CopyToClipboard.html}", note=[Accessed: 16-April-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_copytoclipboard, organization={Wolfram Research}, title={CopyToClipboard}, year={2010}, url={https://reference.wolfram.com/language/ref/CopyToClipboard.html}, note=[Accessed: 16-April-2025 ]}

@online{reference.wolfram_2025_copytoclipboard, organization={Wolfram Research}, title={CopyToClipboard}, year={2010}, url={https://reference.wolfram.com/language/ref/CopyToClipboard.html}, note=[Accessed: 16-April-2025 ]}