You could try using Row State Handler. Quick example without proper error handling:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
f = Function({a},
If(N Items(dt << get selected columns) < 1,
return();
);
Main Menu("Edit:Copy", dt << Get Name);
);
rs = dt << make row state handler(f);
-Jarmo