pill45
pill45

Reputation: 621

How to delete a file in imageJ macro

I am trying to write a macro so in imageJ. I want to apply this macro to different image file.

So in the beginning, I save the selected picture with temp.jpg file name

saveAs("Jpeg", "/Users/pathreskoo/Desktop/IHC/temp.jpg");

After I finish the process, I want to delete the file I try

ok = file.delete("/Users/pathreskoo/Desktop/IHC/temp.jpg");

But the file was not removed. What should I do?

Upvotes: 0

Views: 2712

Answers (1)

Kota
Kota

Reputation: 191

ImageJ macro is case sensitive. Try using File.delete, not file.delete.

https://imagej.nih.gov/ij/developer/macro/functions.html#File.delete

Upvotes: 1

Related Questions