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
DMR
DMR
Level V

Calling a JMP Add-in Menu Item from within the Add-In

My apologies if this is a question with a trivial answer. I've written a JMP add-in which contains an assortment of scripts, all of which are referenced by menu items (for example) "Program A", "Program B", "Program C" etc. I want to be able to run the script referenced by menu item "Program B" via a command contained within the script called by menu item "Program A". Can that be done?

 

Note that I don't want to call the script in question with an "include()" statement, because I don't know what the final version of the script called by menu item "Program B" might be (because I could be working on several versions of it, each with a different name, and might replace it at a later date). I just want to call whatever script is associated with the menu item - so I'm guessing that I'll probably have a line in my JSL script that looks something like "runprogram(com.mycompany.myaddin(Program B))". (Obviously this isn't right, but hopefully you can see what I'm trying to do.)

 

Many thanks

1 ACCEPTED SOLUTION

Accepted Solutions
ian_jmp
Level X

Re: Calling a JMP Add-in Menu Item from within the Add-In

I haven't checked, but perhaps the 'MainMenu()' JSL command will do this. Depending on the menu strtucture you have, something like 'MainMenu("Add-Ins:Program B")' in the code of 'Program A'.

View solution in original post

3 REPLIES 3
ian_jmp
Level X

Re: Calling a JMP Add-in Menu Item from within the Add-In

I haven't checked, but perhaps the 'MainMenu()' JSL command will do this. Depending on the menu strtucture you have, something like 'MainMenu("Add-Ins:Program B")' in the code of 'Program A'.

DMR
DMR
Level V

Re: Calling a JMP Add-in Menu Item from within the Add-In

Hi Ian - that works for me: many thanks!

mikedriscoll
Level VI

Re: Calling a JMP Add-in Menu Item from within the Add-In

I know this is solved but I'll just throw this out there as my two cents. My script file versions are named by version numbers (though github would be a better way I suppose) but for version 0.4, the unencrypted version would be script_name_0v4.jsl, and the current released encrypted version on the server would be script_name_enc.jsl. This doesn't change, so the the add-ins always point to the correct file name.