cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
vince_faller
Super User (Alumni)

Get Path of open script

I'm wondering if you can get the path of an open script like you can with a data table. 

 

Names default to here(1);
// data tables, cool
dt = open("$SAMPLE_DATA\Big Class.jmp");
show(dt << Get Path());
// scripts, not so much. 
w = open("$SAMPLE_DATA\..\scripts\bootstrapsample.jsl");
show(w << Get Path());

@ben_ph 

Vince Faller - Predictum
3 REPLIES 3
SDF1
Super User

Re: Get Path of open script

Hi @vince_faller ,

 

I found this community solution to be helpful and I think it'll do the trick for you, at least in part.

 

Apparently, once the JSL file is open, you can have a line that says Convert File Path(""); and it will show you the current directory. But, I think you need to run it from within the JSL script file. It appears that if you run it from another script window, then it returns the JMP file path.

 

Hope this helps!,

DS

vince_faller
Super User (Alumni)

Re: Get Path of open script

Yeah it needs to be external.  This doesn't work for me.  

Vince Faller - Predictum
johnmoore
Level IV

Re: Get Path of open script

Vince,

 

I have used include file list() before to get the path of a script.

 

include file list()

Don't know if this does what you need.

 

John