Blockland Forums > Modification Help
Getting a code and setting it to clipboard
Brian Smithers:
--- Quote from: Treynolds416 on March 01, 2012, 02:55:18 PM ---look at setClipboard() and getClipboard() here: http://docs.garagegames.com/tge/official/content/documentation/Reference/Console%20Functions/TorqueScript_Console_Functions_13.html#setClipboard.28_string_.29
It might not work for your purposes, it looks like it operates through a GUI
--- End quote ---
test
I used setClipboard("test"); and ctrl v'd that in.
Lugnut:
This will be very useful for me...
Ipquarx:
--- Quote from: Lugnut1206 on March 01, 2012, 03:08:33 PM ---This will be very useful for me...
--- End quote ---
If you're talking about what I think you're talking about, then no, that won't work.
Lugnut:
--- Quote from: Ipquarx on March 01, 2012, 05:00:56 PM ---If you're talking about what I think you're talking about, then no, that won't work.
--- End quote ---
I don't know what you think I'm talking about
Danny Boy:
--- Quote from: halcynthis on March 01, 2012, 02:39:54 PM ---Snip
--- End quote ---
Thanks, I got that to work exactly how I wanted with a small change and it works great.
--- Code: ---function copyFileToClipboard(%m)
{
%string = "";
%file = new fileObject();
%file.openForRead("Add-Ons/"@%m@"");
while(!%file.isEOF())
{
%string = %string SPC %file.readLine();
}
%file.Close();
%file.Delete();
setClipboard(%string);
}
--- End code ---
So now I can type into my console:
copytoclipboard("Server_Whatever/server.cs");
And it worked out well :D