If you are adding them this way, you could create the references while appending them (collect them into a list and not separate variables). If you wish to use XPath you can do something like
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("", lub = Lineup Box());
lub << Append(
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
lub << Append(
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
gbs = (lub << XPath("//OutlineBox[@helpKey = 'Graph Builder']")) << get scriptable object;
without XPath for example
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
nw = New Window("", lub = Lineup Box());
gbs = {};
lub << Append(
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
Insert Into(gbs, gb);
lub << Append(
gb = dt << Graph Builder(
Variables(X(:weight), Y(:height), Overlay(:sex)),
Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
)
);
Insert Into(gbs, gb);
show(gbs);
-Jarmo