Copying text from Log or Cues panel

I’ve been writing some Sonic Pi code that generates a large string of data that I want to save. I’ve been sending it to the Log via puts but I was disappointed to see that I couldn’t highlight or copy text from the Log! I probably should have checked that before writing a whole piece for this purpose… :sweat_smile:

I tried using cue to display the string too but I was still unable to copy it from the cue window.

Is there any way I can get the resulting string out of Sonic Pi and into my clipboard?

You should be able to copy it once you have stopped the current program running.

1 Like

Ah that’s good to know! And for anyone looking for an alternative, I managed to get Sonic Pi writing a string out to a text document using the following:

my_string = "All that we see or seem is but a dream within a dream"
location = "C:/Users/profile/Desktop/test.txt", "w") { |f| f.write my_string}

This function overwrites the current contents of the txt file, but there are others that append to it etc.

1 Like

Thanks for the tip Edgar! :grinning: