cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar

Saving Scripts and Working with Automatic Scripts

Started ‎11-08-2022 by
Modified ‎11-08-2022 by
View Fullscreen Exit Fullscreen

Scripts are typically meant to be run repeatedly over time, and possibly in different situations. In order to maximize the flexibility of scripts, JMP provides several ways for you to save them. You can save a script in a standalone JSL source code file and then open it and run it from the Script Editor or the Debugger. You can save a script to the data table or as a data column formula, so the script only runs in that specific context. You can save it in a journal and run it by clicking a button, as we do with the course data. Finally, if you want the script to be available on demand, you can save it as a JMP add-in in the add-ins menu, as a new menu bar item or a menu item in an existing JMP menu, or as a new toolbar button. Then, there might be scripts that you want to run automatically when certain activities occur. For example, you might have a script that you want to run automatically when you launch JMP. If you save a script with the name jmpStart.jsl in a specific location in your Program Files, it will automatically run every time JMP starts. This could be useful if you want to query a database every time you open JMP, or if you've created custom functions or transforms or formats that need to be re-initialized. You can find the location where this file needs to be saved in the JMP Help documentation for your version of JMP. Another case when you might want a script to run automatically is when you open a data table. A table script named OnOpen will automatically run each time you open the data table. You might use an OnOpen script to update the data table from a database, for example, or to run an analysis automatically.