3
$\begingroup$

If I copy something into the clipboard then use var=Paste[]; I get Null in the var and the clipboard content is printed on the next cell. How do I get the content of the clipboard directly into the variable.

I have a basic text in my clipboard and want it stored as a string.

Moreover Windows 10's clipboard now supports multiple entries. Is there a way to select entries other than the last one?

$\endgroup$
3
$\begingroup$

This works in version 9 / windows 10 (64bit):

var = ToExpression[NotebookGet[ClipboardNotebook[]][[1, 1, 1, 1]]]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.