•
|
On Windows, select File > New > Add-In.
|
•
|
On Macintosh, select File > New > New Add-In.
|
•
|
In Dashboard Builder, select the red triangle menu and then select Save Script > To Add-In.
|
First, in the General Info tab, add the general information that identifies and sets up your add-in.
Figure 15.29 Add-In Builder General Info Tab
This is the name of the registered add-in, which appears in the View > Add-Ins window.
Unique ID strings are case-insensitive. To ensure uniqueness, it is strongly recommended to use reverse-DNS names (for example, com.mycompany.myaddin). The ID string must meet the following requirements:
In JSL, use this string to refer to the add-in (for example, in calls to Get Addin() or as an argument to $ADDIN_HOME).
6.
|
(Optional) Select the check box next to Install after save if you want to install the add-in after saving it.
|
1.
|
Click the Menu Items tab.
|
Figure 15.30 Add-In Builder Menu Items Tab
2.
|
3.
|
If you add a submenu, next to Menu item name, enter the name of the submenu.
|
This name appears in the Add-Ins menu.
4.
|
Click Add Command.
|
5.
|
Next to Menu item name, enter the name of the add-in command.
|
6.
|
(Optional) Next to Tooltip for menu item, enter the content that appears as a tooltip when the users place their cursor over the menu item.
|
7.
|
Add the script. Select either Run this JSL and copy and paste in your script, or select Run JSL in this file and click Browse to find the file containing your script.
|
8.
|
(Optional) Select Use the “Here” namespace for unqualified JSL variable names to ensure that all unqualified JSL variables are in the Here namespace, and local only to the script.
|
–
|
If your script creates a custom menu or toolbar, the variables are in the Here namespace by default.
|
–
|
For more information about the Here namespace, see Advanced Scoping and Namespaces in Programming Methods.
|
12.
|
Click Save and save the add-in to the desired directory.
|
13.
|
Click Close.
|
Note: For more information about customizing menus in JMP, see Personalize JMP in the Using JMP book.
Click the Start-Up Script tab to add a script that runs when JMP starts up (and the add-in starts). You can select an existing script (Run JSL in this file) or copy and paste in a script (Run this JSL). For example, you could provide a message telling the user that the add-in is installed upon start-up.
Click the Exit Script tab to add a script that runs when JMP exits or when you disable the add-in. You can select an existing script (Run JSL in this file) or copy and paste in a script (Run this JSL). For example, you could provide a prompt for the user to export a JMP data table upon exiting or disabling the add-in.
Save the add-in by clicking the Save button on any tab. This effectively creates the add-in.
•
|
If you selected the Install after save option in the General Info tab, then the add-in menu item appears in the Add-Ins menu immediately.
|
•
|
If you did not select the Install after save option, when you open the saved add-in file, you are prompted to install the add-in.
|
1.
|
Select View > Add-Ins.
|
2.
|
Select your add-in and click Unregister.
|
3.
|
Reinstall your add-in by either selecting File > Open in JMP, or by double-clicking your .jmpaddin file.
|