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

JMP Addin Enable/Disable - JSL code to do this?

Is there any JSL code/command that can toggle a JMP Addin to Enable/Disable? 
(note: I do not mean Register/Unregister in this case)

This enabling/disabling can be done manually in View > Add-ins with the Enable checkbox, but I need JSL code to control this in my application.  I also looked into loading the "addinRegistry.xml" as a text file and replacing the last string of "autoLoad="false"" with nothing and saving it, but the issue is that JMP overwrites the xml when it closes and will just overwrite any change I make to it.  And I would rather not have to mess with the .xml of course.  I also realize there is a JSL command as "Register Addin()" with its attribute <<LoadsAtStartup(0) ...but this doesn't seem to disable the Addin and it launches the addin again.  (unless I was doing something wrong)  Any other ideas?  thanks, DJ

1 ACCEPTED SOLUTION

Accepted Solutions
ErraticAttack
Level VI

Re: JMP Addin Enable/Disable - JSL code to do this?

You can do this -- it is not immediately clear how as it is named different from the GUI, but this is what you'd do if you have an addin of ID "com.mycompany.jmpaddin"

Names Default To Here( 1 );
addin = Get Addin( "com.mycompany.myaddin" );
addin << Unload // to "unregister"
addin << Load // to "register"

I don't see any documentation for this though, got it through trial and error...

 

And just to state -- unloading an addin does not get rid of any namespaces / classes / global variables set by the addin.  It just get's rid of any menu customizations and prevents it from loading when JMP starts next.

Jordan

View solution in original post

2 REPLIES 2
ErraticAttack
Level VI

Re: JMP Addin Enable/Disable - JSL code to do this?

You can do this -- it is not immediately clear how as it is named different from the GUI, but this is what you'd do if you have an addin of ID "com.mycompany.jmpaddin"

Names Default To Here( 1 );
addin = Get Addin( "com.mycompany.myaddin" );
addin << Unload // to "unregister"
addin << Load // to "register"

I don't see any documentation for this though, got it through trial and error...

 

And just to state -- unloading an addin does not get rid of any namespaces / classes / global variables set by the addin.  It just get's rid of any menu customizations and prevents it from loading when JMP starts next.

Jordan
djhanson
Level V

Re: JMP Addin Enable/Disable - JSL code to do this?

Excellent!  That works great.  Thanks for sharing this!  DJ