cut 'n paste from linux lua console

Discuss ideas for new features with other users. To submit feature requests to Smith Micro, please visit support.smithmicro.com

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
jorgy
Posts: 779
Joined: Sun Sep 05, 2004 8:01 pm
Location: Colorado, USA

cut 'n paste from linux lua console

Post by jorgy »

Subject says it all - it would be nice to be able to select text from the lua console to paste into other apps. Thanks!!
User avatar
7feet
Posts: 840
Joined: Wed Aug 04, 2004 5:45 am
Location: L.I., New Yawk.
Contact:

Post by 7feet »

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:

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)
...
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.
Post Reply