Ah, right, the get bygroup script() was already there. Indeed, much easier this way : )
(current report()["Contour?"] << get scriptable object) << get by group script
Is quite robust.
It works with JMP17 (talking to the first plot)
... and JMP18 (talking to the Group Platform):
If you use the return value of the report command, you have to be careful to get the script only 1x:
cp =Contour Plot( ... ,By() ); // returns a list
//cp << get script; // 1 script per plot (N times, message sent to a list)
// cp << get bygroup script; // returns the by group Script N times (message sent to a list)
cp[1] << get bygroup script; // 1x