cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Jackie_
Level VI

Enter the file name and save

Hi,

 

I am trying to create a jsl script where the user can type the file name and save as csv. 

Here's what I tried. Save() doesn't work when I enter the variable exE. Any suggestions?

dt = Current Data Table();

current_pref = Char( Arg( Parse( (Char( Get Preferences( Export settings ) )) ), 1 ) );

Pref( Export Settings( End Of Field( Comma ), Export Table Headers( 1 ) ) );

exC = ".cvs";


Nw = new window(""
				,<< modal(),
								   Text box ("Enter File name"),
					               input = Text edit box("", << Set width(100));,
					               Spacer Box( Size( 20, 10 ) ),
				                   Buttonbox("Export", path = pickDirectory("Select the folder to save .CSV file:");
					               aa = input << get text();
					               exE = Concat( aa, exC );
				)
	
);
save( path || "\" || exE );  /// 

Eval( Parse( "pref(" || current_pref || ")" ) );
1 REPLY 1
txnelson
Super User

Re: Enter the file name and save

exC is not recognized within the Modal window, so the simple fix is below

dt = Current Data Table();

current_pref = Char( Arg( Parse( (Char( Get Preferences( Export settings ) )) ), 1 ) );

Pref( Export Settings( End Of Field( Comma ), Export Table Headers( 1 ) ) );

exC = ".cvs";


Nw = New Window( "",
	<<modal(),
	Text Box( "Enter File name" ),
	input = Text Edit Box( "", <<Set width( 100 ) ),
	Spacer Box( Size( 20, 10 ) ),
	Button Box( "Export",
		path = Pick Directory( "Select the folder to save .CSV file:" );
		aa = input << get text();
		
	)
	
);

exE = Concat( aa, exC );
save( path || "\" || exE );  /// 

Eval( Parse( "pref(" || current_pref || ")" ) );
Jim

Recommended Articles