cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Steffen_Bugge
Level IV

Access to folder above main script

I am currently using the Get Default Directory function to run a script in a subfolder of my main script, using the following code

 

relativePath = Get Default Directory();

Include(relativePath || "Folder1/Data import.jsl");

How can I run a script or open a file in a folder above my main script, i.e. in a directory higher than the full directory given by Get Default Directory function?

1 ACCEPTED SOLUTION

Accepted Solutions
mmarchandTSI
Level V

Re: Access to folder above main script

This should work for you.

 

Names Default To Here( 1 );
relativePath = Get Default Directory();
UPone = Left( relativePath, Contains( relativePath, "/", -2 ) );

View solution in original post

3 REPLIES 3
mmarchandTSI
Level V

Re: Access to folder above main script

This should work for you.

 

Names Default To Here( 1 );
relativePath = Get Default Directory();
UPone = Left( relativePath, Contains( relativePath, "/", -2 ) );
Steffen_Bugge
Level IV

Re: Access to folder above main script

Thanks for the reply @mmarchandTSI !

 

This takes me one level up, but what if I need two levels up?

Steffen_Bugge
Level IV

Re: Access to folder above main script

relativePath = Get Default Directory();
UPtwo = Left( relativePath, Contains( relativePath, "/Folder1/", -2 ) );

Thanks again @mmarchandTSI, I solved it with the above code. 

Recommended Articles