Subscribe Bookmark RSS Feed

get current dir path from other file (not the jsl file)

ariel

Community Trekker

Joined:

Jan 14, 2015

Hi guys:)

Small but important question,

I wish to extract the directory path of a table  that's used in my script...

To be clear : when I use the function "get default directory()"  inside the code - it returns the path from were the script file is and not were the data table I use inside the script - (at the beginning the script working on a table that's "currently open" and in the view of current data table).

So, the question is:

How do i get the path of the data table and no the path of the script file

Thanks, Ariel

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

dt = Current Data Table();

dt << getpath;

"C:\Users\...\Desktop\results 2.jmp"

Craige
3 REPLIES
Solution

dt = Current Data Table();

dt << getpath;

"C:\Users\...\Desktop\results 2.jmp"

Craige
ariel

Community Trekker

Joined:

Jan 14, 2015

Thanks!!, it worked

Craige_Hales

Staff

Joined:

Mar 21, 2013

Welcome.  I found the data table message like this:

dt = open("$SAMPLE_DATA/big class.jmp");

showProperties( dt );

Begin Data Update [Action] [Scripting Only]

Clear Column Selection [Action] [Scripting Only]

Recode [Action] [Scripting Only]

...

Copy Multi Columns Properties [Action] [Scripting Only]

Paste Multi Columns Properties [Action] [Scripting Only]

Get Labeled Rows [Action] [Scripting Only]

Get Name [Action] [Scripting Only]

Get Path [Action] [Scripting Only]

Get Property [Action] [Scripting Only]

Get Row States [Action] [Scripting Only]

Get Rows Where [Action] [Scripting Only]

...

The data table is a scriptable object in JMP.  The Show Properties function works with any scriptable object.  The list is the set of messages the data table responds to.  There is more information, and a similar list, in the Help->Scripting Index.

7926_ScriptingIndex.PNG

If you know a keyword, like "path", you can narrow the search:

7932_ScriptingIndexNarrow.PNG

The scripting index can search just Objects, just Functions, just Display boxes, or all three.  In this case, picking Objects, then Data Table, makes it easier because there are a number of Functions and Display boxes that know something about a path as well.

Craige