Sorry, I’m having trouble understanding you (“now nothing happens jiji”). In your screen shot, I see that you define the output dir in line 18, so that is OK. Apparently you did not copy the macro and paste it into the Forum, as the two texts differ. Anyhow. A screen shot text cannot be copied. So please, next time use the copy-paste into the forum and use the </> button in the edit window to get your text recognised as code, rather than posting a screen shot.
I see you are using FIJI. For simple tasks like this, debugging in ImageJ1 is easier than in ImageJ2 (FIJI). Once your code works OK, you can move to FIJI as FIJI understands ImageJ1, but not the other way around.
I suggest we try to solve your issue using an example stack and one stack only, (not the whole directory) combined with a tmp folder (this we can all generate independent of or operating system of local data) to get your code going.
Once we get the sample going, you can do the loop over the file names in your won environment. Currently the NIH site is down, as soon as I find it back, I’ll post some code.