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