how to copy/paste from script MessageBox?

Pete Siamidis wrote on 2/24/2013, 9:09 PM
I have a script that in the end displays a chunk of data using MessageBox() when complete, and I'd like to be able to copy/paste that data to a separate text file for use elsewhere. Right now though it will display the message box, but it won't let me copy the text from it. Is there any way to do this? Alternatively, is there a way to write out this script output to a file so that I can use it elsewhere? I basically build a string using StringBuilder, and it's the data in that string that I need to use after the script is complete, so I need to either be able to write that to a file, or just display it in a MessageBox and copy it from there.

Comments

altarvic wrote on 2/24/2013, 10:09 PM
Have you tried Ctrl+C ? (just press this key combination while the MessageBox on the screen)
Pete Siamidis wrote on 2/25/2013, 1:36 AM
Ah that works, I didn't think it would because the text in the message box isn't selectable. Thanks!
Gary James wrote on 2/25/2013, 8:44 AM
If you eventually decide that you want to save these messages in a text file, it's very easy to accomplish. Simply add the following line in your code before you display your message box.

using System.IO;

File.AppendAllText ( "FullFilePath", "msg" );

This opens or creates the file specified in the string "FullFilePath", appends the "msg" to the contents of the file, then closes the file.
Pete Siamidis wrote on 2/25/2013, 8:55 PM
Perfect, I think I may go with that. Thanks again guys!