Below are two versions of your script. The first one works as you designed it, while the second one is the way I prefer to do these kinds of things, by embedding the save requests right in the Life Distribution output.
//Algorithm: 1. Open an appropriate data file specified by the user..
// 2. Import the file as a JMP data table.
// 3. Perform the Life Distribution on the given data table.
// 4. Allow user to manipulate the file if needed.
// 5. Once needed changes have been made provide user the option to save report as desired file type
// User will choose the file that they would like to open
dt1 = Open();
// The built in Life Distribution platform is performed on the chosen data table
LD = dt1 << Life Distribution(
Y( Column( 1 ) ), //Time Column
Censor( Column( 6 ) ), // Cumulative Hazard Column
Censor Code( 1 ),
<<Fit Weibull,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Probability Paper( Profiler( 1, Confidence Intervals( 1 ), Term Value( Column 1( 80.85, Lock( 0 ), Show( 1 ) ) ) ) ),
Weibull Distribution( Profiler( 1, Confidence Intervals( 1 ), Term Value( Column 1( 80.85, Lock( 0 ), Show( 1 ) ) ) ) ),
Weibull Quantile( Profiler( 1, Confidence Intervals( 1 ), Term Value( Probability( 0.5, Lock( 0 ), Show( 1 ) ) ) ) ),
Weibull Hazard( Profiler( 1, Confidence Intervals( 1 ), Term Value( Column 1( 80.85, Lock( 0 ), Show( 1 ) ) ) ) ),
Weibull Density( Profiler( 1, Term Value( Column 1( 80.85, Lock( 0 ), Show( 1 ) ) ) ) ), Custom Estimation( Weibull, 0 )}
),
Dispatch( {"Compare Distributions"}, "Life Distribution", FrameBox, {Grid Line Order( 2 ), Reference Line Order( 3 )} ),
Dispatch( {"Statistics", "Model Comparisons"}, "", TableBox, {Sort By Column( 2, 1 )} )
);
LD << On Close(
w1 = New Window( "Report Export",
Text Box(
"Would you like to export this report in another format? \!n (Note: There are limitations to the types of file formats \!n this report can be exported. ) \!n"
),
Button Box( "Yes",w1 << Close Window();
w2 = New Window( "Export Report",
Button Box( "Word", report(LD) << save MSword( "$DESKTOP\my_file.doc" ) ),
Button Box( "Power Point", report(LD) << save Presentation( "$DESKTOP\my_file.pptx" ) ),
Button Box( "Close", <<Close Window() )
)
),
Button Box( "No", w1 << Close Window() ),
)
);
Second script:
//Algorithm: 1. Open an appropriate data file specified by the user..
// 2. Import the file as a JMP data table.
// 3. Perform the Life Distribution on the given data table.
// 4. Allow user to manipulate the file if needed.
// 5. Once needed changes have been made provide user the option to save report as desired file type
// User will choose the file that they would like to open
dt1 = Open();
// The built in Life Distribution platform is performed on the chosen data table
LD = dt1 << Life Distribution(
Y( Column( 1 ) ), //Time Column
Censor( Column( 6 ) ), // Cumulative Hazard Column
Censor Code( 1 ),
<<Fit Weibull,
Confidence Interval Method( Wald ),
<<Set Scale( Nonparametric ),
Interval Type( Simultaneous ),
Show Event Plot Frequency Label( 0 ),
<<Set Scriptables(
{Probability Paper( Profiler( 1, Confidence Intervals( 1 ), Term Value( Column 1( 80.85, Lock( 0 ), Show( 1 ) ) ) ) ),
Weibull Distribution( Profiler( 1, Confidence Intervals( 1 ), Term Value( Column 1( 80.85, Lock( 0 ), Show( 1 ) ) ) ) ),
Weibull Quantile( Profiler( 1, Confidence Intervals( 1 ), Term Value( Probability( 0.5, Lock( 0 ), Show( 1 ) ) ) ) ),
Weibull Hazard( Profiler( 1, Confidence Intervals( 1 ), Term Value( Column 1( 80.85, Lock( 0 ), Show( 1 ) ) ) ) ),
Weibull Density( Profiler( 1, Term Value( Column 1( 80.85, Lock( 0 ), Show( 1 ) ) ) ) ), Custom Estimation( Weibull, 0 )}
),
Dispatch( {"Compare Distributions"}, "Life Distribution", FrameBox, {Grid Line Order( 2 ), Reference Line Order( 3 )} ),
Dispatch( {"Statistics", "Model Comparisons"}, "", TableBox, {Sort By Column( 2, 1 )} )
);
w2 = V List Box(
Button Box( "Save to Word", report(LD) << save MSword( "$DESKTOP\my_file.doc" ) ),
Button Box( "Save to Power Point", report(LD) << save Presentation( "$DESKTOP\my_file.pptx" ) ),
Button Box( "Close", LD <<Close Window() )
);
Report(ld)["Life Distribution"]<<prepend(w2);
Jim