Buffer selection within a macro
Submitted by Wednesday, 28 March, 2007 - 11:30
on
Hello all,
first of all I would like to thank the developers. jEdit is a brilliant tool. The opportunity to write own java based macros is an excellent feature. Unfortunately I have some problems in regard to pick up the right buffer for an automatic safe. But before I go into detail I have to mention, that I am not an experienced Java programmer.
What I try to do is to manipulate data from file A and try to safe it in file B.
For this purpose I take the data out of buffer A use the tokenizer to extract the needed data and write that into buffer B.
Therefore I have written the following code:
editPane.prevBuffer();
textArea.setSelectedText(sNewLine+"\n");
textArea.goToNextLine(false);
editPane.nextBuffer();
The pitty is, that I have to ensure that the order in the buffer selector is correct. That is a little bit unconvienient. Does anyone know if there is an opportunity to select the right buffer by its path or filename?
Anything like: editPane.selectBuffer(string filename/path);
I went through the whole helpfile and online wiki, but didn't found anything how I can manage that task. I also tried to record a macro but the file selection was not recorded.
Thank you for your response.
Best wishes, Andre
first of all I would like to thank the developers. jEdit is a brilliant tool. The opportunity to write own java based macros is an excellent feature. Unfortunately I have some problems in regard to pick up the right buffer for an automatic safe. But before I go into detail I have to mention, that I am not an experienced Java programmer.
What I try to do is to manipulate data from file A and try to safe it in file B.
For this purpose I take the data out of buffer A use the tokenizer to extract the needed data and write that into buffer B.
Therefore I have written the following code:
editPane.prevBuffer();
textArea.setSelectedText(sNewLine+"\n");
textArea.goToNextLine(false);
editPane.nextBuffer();
The pitty is, that I have to ensure that the order in the buffer selector is correct. That is a little bit unconvienient. Does anyone know if there is an opportunity to select the right buffer by its path or filename?
Anything like: editPane.selectBuffer(string filename/path);
I went through the whole helpfile and online wiki, but didn't found anything how I can manage that task. I also tried to record a macro but the file selection was not recorded.
Thank you for your response.
Best wishes, Andre