Problem to run a macro

Hello,
I want to use a plugin on multiple image. So i created a java class to do it but when i run it still open a dialog and just give me the half of outputfiles. But i don’t get any error message.
This is my script in Java:.

for (File f : initial.listFiles()) {
            String objectif = "X(\\d+)";
            String wavelength = "L(\\d+)";
            String na = "NA(\\d+)";
            String micro = "M(\\d)";
            Pattern robjectif = Pattern.compile(objectif);
            Pattern rwavelength = Pattern.compile(wavelength);
            Pattern rna = Pattern.compile(na);
            Pattern rmicro = Pattern.compile(micro);
            Matcher mobjectif = robjectif.matcher(f.getName());
            Matcher mwavelength = rwavelength.matcher(f.getName());
            Matcher mna = rna.matcher(f.getName());
            Matcher mmicro = rmicro.matcher(f.getName());

            if (f.toString().endsWith(".czi")&&mobjectif.find( )&&mwavelength.find()&&mna.find()&&mmicro.find()) {
IJ.runPlugIn("Generate_fieldIlluminationReport", "steps=10 microscope=" + mmicro.group(1) + " wavelength=" + mwavelength.group(1) + " na=" + mna.group(1) + " pinhole=1 text1=[Sample infos:\n] text2=Comments:\n scale=5 save save=[C:\\Users\\Guy\\Desktop\\testout\\metroloJ\\Fieldilluminationreportforhomogeneitechamp_X" + mobjectif.group(1) + "_L" + mwavelength.group(1) + "_NA" + mna.group(1) + "_M" + mmicro.group(1) + ".pdf]");

I also tried with macro in Python but I get this error when it comes to run the plugins :java.lang.StringIndexOutOfBoundsException: String index out of range: -1

This is my macro in Python:

from ij import IJ
from ij.process import ImageStatistics as IS
import os
import re

folder = "/Users/Guy/Desktop/RawDataNucleus/test_metro/"

for filename in os.listdir(folder):
	if filename.endswith(".czi"):
		print "Processing ",filename
		IJ.run("Bio-Formats Importer", "open="+folder+filename+" autoscale color_mode=Colorized rois_import=[ROI manager] view=Hyperstack stack_order=XYCZT")
		#imp = IJ.openImage(os.path.join(folder, filename))
		obj = re.search("_X(\d+)",filename)
		wave= re.search("_L(\d+)",filename)
		na = re.search("_NA(\d+)",filename)
		micro = re.search("_M(\d+)",filename)
		if obj and wave and na and micro != None:
			Object = obj.group(1)
			Wavelength = wave.group(1)
			AN = na.group(1)
			mmicro = micro.group(1)
			print(Object, Wavelength, AN, mmicro)
		   	IJ.run("Generate field illumination report", "steps=10 microscope=Confocal wavelength=" + Wavelength + " na=" +AN+ " pinhole=1 text1=[Sample infos:TITOTOTOOT\n] text2=Comments:\n scale=5 save save=["+folder+"Field illumination_X" + Object + "_L" + Wavelength + "_NA" + AN + "_M" + mmicro + ".pdf]");		
		
       		

Does anyone has any idea of how to solve this exception ?.
Thank you in advance.