Programming in imagej

I have written a code for calculating the area using macros in ImageJ. But I have hundreds of similar images in the file. The code works for all the images when I process them individually. Can this work be automated so that I can input a given stack of images and all the areas of respective frames are displayed?

Have a look at the batch processing function of ImageJ:

thanks, @Bio7 for the help

Hi,
I followed your advice and performed batch processing on my code. It worked beautifully for all the files. But the problem is I need to find a way to segregate my results.
I mean for my problem each file contains 2 images of bubbles whose information i am finding using my script. But their are nearly thousand such files. So when i do batch processing It simply gives me the results one after the other. i have to manually find which result corresponds to which file. Can u suggest me a method to automate this process and store the results in an xls format.
regards,
finchy

There are multiple examples in the archives, e.g.:

http://imagej.1557.x6.nabble.com/how-to-append-results-in-excel-file-td5002126.html

http://imagej.1557.x6.nabble.com/Saving-multiple-result-windows-into-the-same-excel-file-td5016205.html

http://imagej.1557.x6.nabble.com/How-to-create-a-customised-results-table-and-add-data-to-it-within-a-macro-td5000701.html

http://imagej.1557.x6.nabble.com/Modify-or-create-results-table-td5011481.html

But it highly depends on your macro.

Thanks once again for your help.
Regards,
finchy