cut 'n paste from linux lua console
Moderators: Víctor Paredes, Belgarath, slowtiger
cut 'n paste from linux lua console
Subject says it all - it would be nice to be able to select text from the lua console to paste into other apps. Thanks!!
Two things you can do (from inside the script).
First, a simple line of "io.output(path)" (you pick the path of course) should redirect the standard output (which here is the console) to the file of you're choice. I haven't tried it, but that's the way it's supposed to work. But then you won't see the result in the console.
The other is to open a file and then mirror the print functions with write functions:
Not quite the same as cut and paste from the console, which I wouldn't mind and have wanted to use before, but it'll get you by for now.
First, a simple line of "io.output(path)" (you pick the path of course) should redirect the standard output (which here is the console) to the file of you're choice. I haven't tried it, but that's the way it's supposed to work. But then you won't see the result in the console.
The other is to open a file and then mirror the print functions with write functions:
Code: Select all
outputPath = "c:\\moho\\scripts\\outputfile.txt" - windows format - whatever you like
local file = io.open(outputPath, "w") -- or "a+" to add to the end of existing file
...
print(result)
outputFile:io.write(result)
...