cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
tikhahabusamah
Level II

How to call an add in using a script in jrn

Hi, I'm new and need some help. I've learn how to create script button at jrn and manage to automate t test comparison manually. However, I already had addin Data Comparison which is much more easier for me. Somehow I want to make the script button to open the addin selection. my current jrn button script is like this,

 

it open from origin path of addin (view -> home folder jsl)

I read somewhere in forum that I need to include this line:


include( "$ADDIN_HOME(com.xxx.xxx)\Continuous\Sample Comparison.jsl" );

 

but it seems not working in my jrn. NEED HELPP how to automatically run the jsl from addin through jrn.

so I try to do something like this:

 

Names Default To Here( 1 );
dt=Open("$ADDIN_HOME(com.xxx.xxx)\Continuous\Sample Comparison.jsl");

 

it can open but cannot run the script. Does anyone know why? NEED HELP 

 

JRN.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How to call an add in using a script in jrn

Try changing the include path to the actual path to the Addin folder.

 

Also,

I may have misread your initial entry.  I read it that the Display Screen that you included was what you were having pop up when you included the Addin's JSL, and it was at that point you needed to run the JSL under each button.  Apparently that is not the case.  Therefore, my JSL to have one of the button's "Click"ed is not appropriate.

 

This is a bit of a kluge, but, if you can open the file, you should be able to 

theFile = load text file("$ADDIN_HOME(com.xxx.xxx)\Continuous\Sample Comparison.jsl);
save text file("$TEMP/myfile.jsl",thefile);
include("$TEMP/myfile.jsl");
Jim

View solution in original post

7 REPLIES 7
txnelson
Super User

Re: How to call an add in using a script in jrn

You should be able to execute the button of your choice by doing the command that pops up the display window, and then running the following 

window("the window name")["button workflow"][buttonbox(1)]<<click
Jim
Craige_Hales
Super User

Re: How to call an add in using a script in jrn

I think you are saying the script opens in a JSL editor rather than running. Change open(...) to include(...) might work.

Craige
tikhahabusamah
Level II

Re: How to call an add in using a script in jrn

correct me if I'm wrong but does the button script be like this?

 

 

Names Default To Here( 1 );
dt << Include( "$ADDIN_HOME(com.xxx.xxx)\Continuous\Sample Comparison.jsl" );

 

 

I try the code above,but it will only open the .jsl window but cannot run on .jsl window and cannot automatically run it.

txnelson
Super User

Re: How to call an add in using a script in jrn

Try changing the include path to the actual path to the Addin folder.

 

Also,

I may have misread your initial entry.  I read it that the Display Screen that you included was what you were having pop up when you included the Addin's JSL, and it was at that point you needed to run the JSL under each button.  Apparently that is not the case.  Therefore, my JSL to have one of the button's "Click"ed is not appropriate.

 

This is a bit of a kluge, but, if you can open the file, you should be able to 

theFile = load text file("$ADDIN_HOME(com.xxx.xxx)\Continuous\Sample Comparison.jsl);
save text file("$TEMP/myfile.jsl",thefile);
include("$TEMP/myfile.jsl");
Jim
Craige_Hales
Super User

Re: How to call an add in using a script in jrn

No, just use

include( "$ADDIN_HOME(com.xxx.xxx)\Continuous\Sample Comparison.jsl" );

 

The << operator sends a message on the right side to the object on the left side. That's not what you have.

 

dt = open(...)

is appropriate if the file is a JMP data table (.jmp file) and dt becomes a reference to the opened table. That's not what you have either. Open can open many file types; opening .jsl results in an editor window.

 

Include(...) runs the .jsl file. Include() is a function, not a message.

Craige
txnelson
Super User

Re: How to call an add in using a script in jrn

@Craige_Hales 

I agree that using the include() directly pointing to the $ADDIN_HOME reference is preferred....however, @tikhahabusamah  stated

 

"include( "$ADDIN_HOME(com.xxx.xxx)\Continuous\Sample Comparison.jsl" );

 

but it seems not working in my jrn. NEED HELPP how to automatically run the jsl from addin through jrn.

so I try to do something like this:"

 

But an Open() did work.....thus my work around using the Load Text File()

Jim
tikhahabusamah
Level II

Re: How to call an add in using a script in jrn

yes its working now if i save the jsl file first. thank you @Craige_Hales and @txnelson !