Gareth,
Enclosing your commands in a for loop is all you need to do
selectWindow("Result shared pixels");
run("Set Measurements...", "area mean min area_fraction redirect=None
decimal=3");
for (s = 1; s < nSlices(); s++){
setSlice(s);
run("Measure");
}
Check out the macro guide and list of macro commands:
http://rsbweb.nih.gov/ij/developer/index.htmlhttp://rsbweb.nih.gov/ij/developer/macro/functions.htmlMichael