The script that @Craige_Hales gave you is a real gift. It is a real tool that you can use to learn how to solve your problem by studying how Craige solved the problem. My suggestion is for you to take the the provided script, and walk through it, using the Scripting Guide from the JMP Documentation Library and the Scripting Guide and learn how it works. And if you have trouble understanding how it is working that you query the Discussion Community for guidance.
If you do not have time or capability of doing that, listed on this JMP website are JMP Partners that are in the business of providing such solutions for cost. The would be very interested in helping you.
Jim