For Each() is new function introduced in JMP16, so if you are using older version of JMP you won't find it in scripting index (and it will give an error). You could convert it to for-loop if you wanted to:
Names Default To Here( 1 );
Open( "$SAMPLE_DATA/Cars.jmp" );
r = Current Data Table() << Get rows where( :Make == "Mazda");
/*For Each({cr,ii}, r,
:headic[cr] = :headic[cr]/2
);*/
For(ii = 1, ii <= N Items(r), ii++,
cr = r[ii];
:headic[cr] = :headic[cr]/2;
);
For Each(names, container, locals, body) (jmp16 help)
-Jarmo