Skip to main content
2 of 3
added 94 characters in body
Conor Cosnett
  • 7.7k
  • 1
  • 24
  • 47

Wrapping the CopyToClipboard[] in a UsingFrontEnd[] allows us to use it scripts:

#!/usr/bin/env wolframscript

string = "Pshhhkkkkkrrrrkakingkakingkakingtshchchchchchchchchdingdingding";
UsingFrontEnd[CopyToClipboard[string]];

If a FrontEnd is already running you may have to quit it, and then rerun this script

Conor Cosnett
  • 7.7k
  • 1
  • 24
  • 47