Ah, sorry, you are right, the individual items are indeed scriptable.
Interesting: a batch message like items << get label
produces the same issue.
maybe batch messages use for each in the background ?
Digging deeper, I found an old ticket: TS-00128192
Fortunately, in the mean time the issue got enough prio -- in JMP19 (EA5) it's fixed:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = Graph Builder(
Variables( X( :height ), Y( :weight ), Overlay( :sex ), Color( :age ) ),
Elements( Points( X, Y, Legend( 1 ) ), Smoother( X, Y, Legend( 2 ) ) )
);
server = gb << Get Legend Server;
items = server << Get Legend Items;
items << get label // same issue as with for each
show(items[1][1])
items[1][1] << get label(); // OK, on the lowest level, there is a scriptable object
Show(tmp = items[1][1::2]); // then this is a list of ...
tmp[1] << get Label(); // ...no