Set input/output in batch plugin

Hello everyone,
I’m trying to create a java plugin that execute some analysis on every file in a directory. The problem is that the command that the macro recorder give to me doesn’t work properly because it doesn’t affect the input or the output.
This is the command but even if i change the section in input=[] and output=[] the batch process is executed on the last directory used in imagej."Macro... ", "input=[C:/Ddewx/Input/] output=[C:/Ddewx/Output/] output_format=TIFF file=[] text1=[run(\"Make Binary\");\nrun(\"Analyze Particles...\", \"  show=Ellipses display\");\n]");

Do u have any tip to make this change the input and output?

Thanks in advance

I am not familiar with what you try to do here.
How did you generate this code?

From what I see is that you define the variables input and output.
But you do not use them later on in the text1=[run… command.

I don’t understand also why you want to write a java plugin that then just executes a script. Why not just use a plain old script?

I created this code with the Macros>Record imagej tool. This is the code that the Record returned to me after I used Process>Batch>Macro and then I selected the Input, the Output and then I clicked on Process.
Can you give me some more information about the script that i should use insted of the Batch>Macro?
Thanks a lot

Ah ok now I get it. The stuff you used works only if you use the GUI mask but not when you recorded it as a script. If you want to use a plain script then you use the Batch template.

Just follow the description here were both options are described: