You can either check for JMP version
If(Word(1, JMP Version(), ".") == "18",
tbs = ccr << XPath("//TextBox[contains(text(), 'Legacy Control Charts are being removed in JMP 19.')]");
tbs << Visibility("Collapse");
);
or you can check if the text boxes are found using N Items
tbs = ccr << XPath("//TextBox[contains(text(), 'Legacy Control Charts are being removed in JMP 19.')]");
If(N Items(tbs) > 0,
tbs << Visibility("Collapse");
);
And if you happen to have this left in JMP19 you most likely will run into error before that (but who knows how it will be handled, in "worst" case you can still script it even in JMP19 even though it is totally gone from menus).
-Jarmo