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
Victor3
Level II

How do I assign file folder path when I open file explore?

Hi expert,

 

I would like to write a jsl to query user to assign a file to import. It's always open the same folder as my jsl file. I would like to open desktop when pop up the file explore. Can I do that?

Names Default To Here( 1 );

New Window( "File explore",
	<<modal,
	Spacer Box( size( 20, 10 ) ),
	Text Box( "Choose a log.txt file:" ),
	BB1 = Button Box( "Pick file",
		D = Pick File();
		If( D != "",
			file1 << set text( D )
		);
	),
	file1 = Text Box( ), 

);
Victor Huang
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How do I assign file folder path when I open file explore?

Scripting Index has sometimes very good examples

jthi_0-1722839051200.png

In this case if you want it to open on Desktop, you can use $DESKTOP path variable

Names Default To Here(1);

New Window("File explore",
	<<modal,
	Spacer Box(size(20, 10)),
	Text Box("Choose a log.txt file:"),
	BB1 = Button Box("Pick file",
		D = Pick File("Select file", "$DESKTOP");
		If(D != "",
			file1 << set text(D)
		);
	),
	file1 = Text Box(), 

);
-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: How do I assign file folder path when I open file explore?

Scripting Index has sometimes very good examples

jthi_0-1722839051200.png

In this case if you want it to open on Desktop, you can use $DESKTOP path variable

Names Default To Here(1);

New Window("File explore",
	<<modal,
	Spacer Box(size(20, 10)),
	Text Box("Choose a log.txt file:"),
	BB1 = Button Box("Pick file",
		D = Pick File("Select file", "$DESKTOP");
		If(D != "",
			file1 << set text(D)
		);
	),
	file1 = Text Box(), 

);
-Jarmo