Run the platform once, right click on correct table and choose make into datatable, check out result tables table script and finally get value from the result table. From these steps you can build the script and modify it as needed. Below is one example, built using scripting index example and make into datatable's table script (and couple of my own modifications):
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Cities.jmp");
dist = dt << Distribution(Column(:PM10), invisible);
dist << Process Capability(LSL(5), Target(40), USL(75));
dt_result = Report(dist)[Outline Box("Distributions")][Outline Box("PM10")][Outline Box("Process Capability")][Outline Box("PM10 Capability")][
Outline Box("Within Sigma Capability")][Table Box(1)] << Make Into Data Table(invisible);
Report(dist) << Close Window;
cp_idx = Loc(dt_result[0, "Index"], "Cp")[1];
cp_value = Column(dt_result, "Estimate")[cp_idx];
Show(cp_value);
Close(dt_result, no save);
-Jarmo