1
$\begingroup$

I want to copy some cell as 'Cell Expression', more precisely, by using 'Edit -> Copy As -> Cell Expression'.

However, whenever I try to do this for large output, I first need to click 'show all', and then I can copy it correctly. The problem is that whenever I tries to show them all, it takes a huge amout of time to wait. How can I bypass this issue?

Thank you.

$\endgroup$
3
  • $\begingroup$ You can do Cell[ BoxData @ ToBoxes @ yourInputCode, "Output"] for Cell Expression. Is that what you are after? $\endgroup$ Commented Sep 3, 2024 at 4:21
  • $\begingroup$ @Kuba and you can use CopyToClipboard@Cell[BoxData@ToBoxes[Range[10^5]], "Output"]; to directly get it into your clipboard. (Using Range[10^5] as a generic example of something that produces large output). $\endgroup$ Commented Sep 3, 2024 at 10:40
  • $\begingroup$ Maybe you can use Iconize to get a compact output, and then copy the output instead, like Range[10^5] // Iconize and then copy the icon as the output. $\endgroup$ Commented Sep 4, 2024 at 7:03

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.