Dividing the pixels value within a rectangular ROI to another rectangular ROI mean value

Hello everyone.

I am trying to write a macro in which I would like to automatically divide a series of Rectangular ROIs to the mean value of another series of ROIs. I am trying to put it in a For loop but still struggling to get the result I want. Any help will be appreciated. Here is the macro I have so far…

macro "changeWH" {
			getBoundingRect(x, y, w, h);
			wNew = getNumber("width?", 1); 
			hNew= getNumber("height?", 3);
 w = getWidth;
 h = getHeight;
			for (i=0; i < w; i++) {
run("Specify...", "width=wNew height=hNew i yNew");

getStatistics(mean);  //?????????????
run("Select None");
makeRectangle(i, 0, wNew, h);
			  run("Divide...", "value="+mean);   //????????????