cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
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

Recommended Articles