Send Selection To ...
Submitted by Friday, 4 July, 2008 - 07:53
on
Hello o/
I'm currently trying to write a macro to Send Selection To Python, but I need some help to improve the stuff : I would like to be able to switch back to make active the previous buffer (the one the selecton came from) and the best would be maybe to do that in a transparent way without having the file popping into jEdit. I tried with the jEdit.openTemporary(); but didnt figured how to make it work. Some help would be really appreciated Here is the simple macro so far :
// Send Selected Text To Python
String pythonPath = "D:\\Softwares\\Developpement\\Python25\\pythonw.exe";
String currentFile = "D:\\_Temp\\_SendSelectedTextToPython.py";
Registers.copy(textArea,'$');
jEdit.newFile(view);
Buffer newBuffer = view.getBuffer();
Registers.paste(textArea,'$',false);
newBuffer.save(view, currentFile);
runInSystemShell(view, "\"" + pythonPath + " -t \"" + currentFile + "\"");
I'm currently trying to write a macro to Send Selection To Python, but I need some help to improve the stuff : I would like to be able to switch back to make active the previous buffer (the one the selecton came from) and the best would be maybe to do that in a transparent way without having the file popping into jEdit. I tried with the jEdit.openTemporary(); but didnt figured how to make it work. Some help would be really appreciated Here is the simple macro so far :
// Send Selected Text To Python
String pythonPath = "D:\\Softwares\\Developpement\\Python25\\pythonw.exe";
String currentFile = "D:\\_Temp\\_SendSelectedTextToPython.py";
Registers.copy(textArea,'$');
jEdit.newFile(view);
Buffer newBuffer = view.getBuffer();
Registers.paste(textArea,'$',false);
newBuffer.save(view, currentFile);
runInSystemShell(view, "\"" + pythonPath + " -t \"" + currentFile + "\"");