Subscribe Bookmark RSS Feed

Inserting a Prompt into a script which can change column names

Joe

Occasional Contributor

Joined:

Jan 5, 2017

Hi All,

 

I am creating an automated script which people can use to input their data for analysis. The excel tabs will have preset names "Tab 1", "Tab 2" etc. so that the script works through to the data analysis.

I was wondering whether it would be possible to input a window which pops up once the JMP script is run, which they are then able to change the preset "Tab 1" names to another name which they can type in? Basically the prompt should be a text box which they can type in what they wish to rename the tab?

 

Thank you in advance,

Joe

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Here is a simple script that opens a display box and asks for the user's input, and returns the names of the first and second tab

Names Default To Here( 1 );
Tab1 = "Tab 1";
Tab2 = "Tab 2";
nw = New Window( "Enter Names of the Tabs",
	modal,
	V List Box(
		Text Box( "Here are the default names of the" ),
		Text Box( "tabs from the Excel file to read the" ),
		Text Box( "data from.  Please change the names" ),
		Text Box( "if the tabs have different names" ),
		Spacer Box( size( 1, 10 ) ),
		t1 = Text Edit Box( "Tab 1", <<set script( Tab1 = t1 << get text ) ),
		t2 = Text Edit Box( "Tab 2", <<set script( Tab2 = t2 << get text ) )
	)
);
Show( tab1, tab2 );
Jim
1 REPLY
txnelson

Super User

Joined:

Jun 22, 2012

Solution

Here is a simple script that opens a display box and asks for the user's input, and returns the names of the first and second tab

Names Default To Here( 1 );
Tab1 = "Tab 1";
Tab2 = "Tab 2";
nw = New Window( "Enter Names of the Tabs",
	modal,
	V List Box(
		Text Box( "Here are the default names of the" ),
		Text Box( "tabs from the Excel file to read the" ),
		Text Box( "data from.  Please change the names" ),
		Text Box( "if the tabs have different names" ),
		Spacer Box( size( 1, 10 ) ),
		t1 = Text Edit Box( "Tab 1", <<set script( Tab1 = t1 << get text ) ),
		t2 = Text Edit Box( "Tab 2", <<set script( Tab2 = t2 << get text ) )
	)
);
Show( tab1, tab2 );
Jim