cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Sukanyap
Level II

How do I let user select their files to open via JSL?

Hi All,

As I'm new user to JMP, I want to know how do I open any csv file  without specifying any folder in the JSL script. 

I have saved this script from data table but instead of opening the folder and hence csv file from here I want the users to select folder and open any csv like in below image.

Sukanyap_1-1686484702008.png

Thanks !

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: How do I let user select their files to open via JSL?

The simplest form of what you specified you need is:

Names Default To Here( 1 );
file = Pick File(
	"Select csv File",
	"$HOME",
	{"csv Files|csv", "All Files|*"},
	1,
	0
);
If( file != "",
	dt = Open( file )
);

Look in the Scripting Index for the definitions and examples of the Pick File and Open functions.

Jim

View solution in original post

Sukanyap
Level II

Re: How do I let user select their files to open via JSL?

5 REPLIES 5
Sukanyap
Level II

Re: How do I let user select their files to open via JSL?

One more I want to add is I tried "Pick File" to select any folder and open the csv file but it is throwing error as below 

Sukanyap_0-1686485628651.png

 

txnelson
Super User

Re: How do I let user select their files to open via JSL?

The simplest form of what you specified you need is:

Names Default To Here( 1 );
file = Pick File(
	"Select csv File",
	"$HOME",
	{"csv Files|csv", "All Files|*"},
	1,
	0
);
If( file != "",
	dt = Open( file )
);

Look in the Scripting Index for the definitions and examples of the Pick File and Open functions.

Jim
Sukanyap
Level II

Re: How do I let user select their files to open via JSL?

Thanks it worked

Sukanyap
Level II

Re: How do I let user select their files to open via JSL?

Hi txnelson,

 

Your commands helped me, but now since we're directly opening any data table it seems JMP is not reading the change in data types of the user density here arrow marked. Originally the data type of "user density" is "numeric and continuous" but in my JSL i changed it to character and nominal, but it seems JMP is not reading this, since we're opening the data table directly 

Sukanyap_0-1687515707421.png

 Can you please help me here, how do I make JMP possible to ready my changes, it is needed in my plotting and data processing 

Sukanyap_1-1687515879518.png

 

txnelson
Super User

Re: How do I let user select their files to open via JSL?

It is not really to debug your issue without having your data files.  I suggest you use the Excel Wizard on the files that are not being handled correctly.  The wizard should give you some insight on how JMP is interpreting your files.

Jim