Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
terapin
Level V

JSL Retrieve path after Open | Pick File

I'm creating an interface for coworkers to use so they can start a reasonable directory and then navigate to a specific location where their data files exist and open them.  I want to save just the path they navigated to for future use in the JSL code.  I can't seem to figure out how to accomplish this though.  Any suggestions would be greatly appreciated.

 

Names Default To Here( 1 );

Set Path Variable( "dir_rawdata", "C:\" );

dt = Open(
	Pick File( "Select Data File ", "$dir_rawdata/", {"CSV Files|csv", "All Files|*"} ),
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Comma, CSV( 1 ) ),
		Strip Quotes( 1 ),
		Use Apostrophe as Quotation Mark( 0 ),
		Scan Whole File( 1 ),
		Treat empty columns as numeric( 0 ),
		CompressNumericColumns( 0 ),
		CompressCharacterColumns( 0 ),
		CompressAllowListCheck( 0 ),
		Labels( 1 ),
		Column Names Start( 2 ),
		Data Starts( 3 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);			
	

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: JSL Retrieve path after Open | Pick File

Save the result returned by Pick File in a variable. You can use various character string functions to obtain the path from this string.

Learn it once, use it forever!

View solution in original post

2 REPLIES 2
Highlighted

Re: JSL Retrieve path after Open | Pick File

Save the result returned by Pick File in a variable. You can use various character string functions to obtain the path from this string.

Learn it once, use it forever!

View solution in original post

Highlighted
terapin
Level V

Re: JSL Retrieve path after Open | Pick File

Thanks Mark,

 

I'll try what you suggested.  

Article Labels

    There are no labels assigned to this post.