Hi Txnelson - thank you for your help!
The text box pop-up works for me, but it will not save the user inputed name to an Excel tab (and the Excel tab is not even created). I believe I need to incorporate "dtFINAL" in the "Create Excel Worksheet" script somehow as that is the table I want to save in an Excel tab. This is my full script:
Set Default Directory ( "c:/");
dt = Open ("616641_US JTBD Final.jmp");
md = dt << MaxDiff(
One Table( 1 ),
Subject ID( :Subject ID ),
Choice Set ID( :Choice Set ID ),
Profile ID( :Response Indicator ),
Profile Effects( :"Profile ID (Milkshake)"n ),
Response Value Indicates Best( 1 ),
Response Value Indicates Worst( -1 )
);
md << Save Utility Formula;
md << close window;
tb = dt << Tabulate(
Add Table(
Column Table( Analysis Columns( :Utility Formula ), Statistics( Mean, N ) ),
Row Table( Grouping Columns( :"Profile ID (Milkshake)"n ) )
)
);
tb << Make Into Data Table;
dtFINAL = Current Data Table ();
tb << close window;
//Script from TxNelson
Names Default To Here( 1 );
nw = New Window( "Enter",
<<modal,
H List Box(
Text Box( "Enter name for Excel Tab" ),
Spacer Box( size( 10, 0 ) ),
theInput =
Text Edit Box( "",
<<setwidth( 100 ),
<<set script(
theName = theInput << get text
)
)
)
);
// This portion doesn't work
Create Excel Workbook( "c:/results.xlsx", theName );
Close (dtFINAL, nosave);
Data Table( "616641_US JTBD Final" ) << Delete Columns( :Utility Formula );