<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Getting my script to wait for platform to finish in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Getting-my-script-to-wait-for-platform-to-finish/m-p/278110#M54020</link>
    <description>&lt;P&gt;Hi all&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope you can help me with a large problem, my scrip is making a new window with a report header, then the user is putting in the columns for analysis and click OK. From that analysis I make a "Combined Data Table" but it always fails because the scrip it not waiting for the platform to finish. So my report generation stops.&lt;/P&gt;
&lt;P&gt;I know the script works when I use a list for named columns or for a list of numeric columns, but that solution is not useful in this case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks Jakob&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Script Below here&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//!
Names Default To Here( 1 );
col = Current Data Table();
nw = New Window( "Measurering Report", 

//Header for report

    nw1 = V List Box(
        Lineup Box(
            2,
            Outline Box( "Report Number" ),
            Text Edit Box( "", &amp;lt;&amp;lt;Set Width( 700 ) ),
            Outline Box( "Drawing Number" ),
            Text Edit Box( "", &amp;lt;&amp;lt;Set Width( 700 ) ),
            Outline Box( "KOM Number" ),
            Text Edit Box( "", &amp;lt;&amp;lt;Set Width( 700 ) ),
            Outline Box( "Supplier and Form Number" ),
            Text Edit Box( "", &amp;lt;&amp;lt;Set Width( 700 ) ),
            Outline Box( "Program Name" ),
            Text Edit Box( "", &amp;lt;&amp;lt;Set Width( 700 ) ),
            Outline Box( "Measurement Equipment" ),
            Text Edit Box( "", &amp;lt;&amp;lt;Set Width( 700 ) ),
            Outline Box( "Comments" ),
            Text Edit Box( "


", &amp;lt;&amp;lt;Set Width( 700 ) ),
            Outline Box( "Signature &amp;amp; Date" ),
            Text Edit Box( "


", &amp;lt;&amp;lt;Set Width( 700 ) )
        ), 

        Text Box( " " )
    ), 

    dt = Current Data Table();
    obj = Variability Chart(
        Ignore Platform Preferences( 1 ),
        Model( "Crossed" ),
        Historical Sigma( 0 ),
        Connect Cell Means( 1 ),
        Mean of Std Dev( 1 ),
        Name( "Reduced Gauge R&amp;amp;R Report" )(1),
        Name( "Gauge R&amp;amp;R" )(6, 0.24),
        Name( "Gauge R&amp;amp;R Report" )(1),
        Misclassification Probabilities( 0 ),
        Variance Components( 0 ),
        Mean Plots( 1 ),
        Std Dev Plots( 1 ),
        Automatic Recalc( 1 ), 

    );
);
//if(OK button = run / No Ok wait(1));
dt1 = Current Report()[Outline Box( "Variability Gauge" )][Outline Box( "Gauge R&amp;amp;R" )][Table Box( 2 )] &amp;lt;&amp;lt;
Make combined Data Table;
Wait( 10 );
dt1 &amp;lt;&amp;lt; Set name( "GRR1.jmp" );
Data Table( "GRR1.jmp" );
:Y &amp;lt;&amp;lt; Set Name( "# Number" );
Data Table( "GRR1.jmp" );
Column( 2 ) &amp;lt;&amp;lt; Set Name( "Results" );
Data Table( "GRR1.jmp" );
Column( 3 ) &amp;lt;&amp;lt; Set Name( "Data" );
Data Table( "GRR1" ) &amp;lt;&amp;lt; Split(
    Split By( :Data ),
    Split( :Results ),
    Group( :Name( "# Number" ) ),
    Sort by Column Property
);
dt2 = Current Data Table();
dt2 &amp;lt;&amp;lt; Set name( "GRR2.jmp" );
Data Table( "GRR2" ) &amp;lt;&amp;lt; Subset(
    All rows,
    columns( :Name( "# Number" ), :k, :Name( "Precision/Tolerance Ratio = RR/(USL-LSL)" ) )
);
dt3 = Current Data Table();
dt3 &amp;lt;&amp;lt; Set name( "GRR3.jmp" );
Data Table( "GRR3.jmp" );
Column( 3 ) &amp;lt;&amp;lt; Set Name( "PT Ratio" );
Data Table( "GRR3.jmp" );
New Column( "PT Ratio Result",
    Character,
    "Nominal",
    Set Property( "Value Colors", {"Accepted" = 4, "Not Accepted" = 19, "Partly Accepted" = 41} ),
    Formula( If( :PT Ratio &amp;lt;= 0.3, If( :PT Ratio &amp;lt;= 0.1, "Accepted", "Partly Accepted" ), "Not Accepted" ) ),
    Color Cell by Value,
    Set Selected,
    Set Display Width( 200 )
);
Close( "GRR1.jmp", No Save );
Close( "GRR2.jmp", No Save );
Data Table( "GRR3.jmp" ) &amp;lt;&amp;lt; Sort( By( :Name( "# Number" ) ), Order( Ascending ), Output Table( "GRR Report" ) );
Close( "GRR3.jmp", No Save );
Data Table( "GRR Report.jmp" ):PT Ratio &amp;lt;&amp;lt; Format( "Fixed Dec", 20, 2 );
Data Table( "GRR Report.jmp" ) &amp;lt;&amp;lt; Select Columns( all );
dt = Data Table( "GRR Report.jmp" );
Get Window( nw )[Text Box( 9 )] &amp;lt;&amp;lt; Sib Append( H List Box( Outline Box( "GRR Report", dt &amp;lt;&amp;lt; Get As Report ) ) );
nw[Table Box( 1 )] &amp;lt;&amp;lt; Set Scrollable( 0, 0 );

wlist = Get Window List() &amp;lt;&amp;lt; Get Window Title();
choose_window = Function( {},
    win = New Window( "Select a Report",
        &amp;lt;&amp;lt;Modal,
        hb = H List Box(
            Panel Box( "Select a report window",
                tcf = List Box( wlist, Max Selected( 1 ), chosen = tcf &amp;lt;&amp;lt; Get Selected() )
            ), 

        )
    );
    chosen;
);
chosen = choose_window();
w = Window( chosen[1] );
w &amp;lt;&amp;lt; Report;
//you might need to scale the report to fit in the pdf page
w &amp;lt;&amp;lt; Set page setup( margins( 0.2, 0.5, 0.2, 0.5 ), scale( .75 ), Landscape( 1 ), paper size( "A4" ) );
path = Pick Directory( "Select a directory" );
Set Default Directory( path );
w &amp;lt;&amp;lt; Save Interactive HTML();
w &amp;lt;&amp;lt; Set page setup( margins( 0.2, 0.5, 0.2, 0.5 ), scale( .75 ), Landscape( 1 ), paper size( "A4" ) );
w &amp;lt;&amp;lt; save pdf();
Data Table( "GRR Report" ) &amp;lt;&amp;lt; save( "" );
nt = Current Data Table();
nt &amp;lt;&amp;lt; Save();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 11 Jun 2023 11:03:27 GMT</pubDate>
    <dc:creator>Jakob</dc:creator>
    <dc:date>2023-06-11T11:03:27Z</dc:date>
    <item>
      <title>Getting my script to wait for platform to finish</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-my-script-to-wait-for-platform-to-finish/m-p/278110#M54020</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope you can help me with a large problem, my scrip is making a new window with a report header, then the user is putting in the columns for analysis and click OK. From that analysis I make a "Combined Data Table" but it always fails because the scrip it not waiting for the platform to finish. So my report generation stops.&lt;/P&gt;
&lt;P&gt;I know the script works when I use a list for named columns or for a list of numeric columns, but that solution is not useful in this case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks Jakob&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Script Below here&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//!
Names Default To Here( 1 );
col = Current Data Table();
nw = New Window( "Measurering Report", 

//Header for report

    nw1 = V List Box(
        Lineup Box(
            2,
            Outline Box( "Report Number" ),
            Text Edit Box( "", &amp;lt;&amp;lt;Set Width( 700 ) ),
            Outline Box( "Drawing Number" ),
            Text Edit Box( "", &amp;lt;&amp;lt;Set Width( 700 ) ),
            Outline Box( "KOM Number" ),
            Text Edit Box( "", &amp;lt;&amp;lt;Set Width( 700 ) ),
            Outline Box( "Supplier and Form Number" ),
            Text Edit Box( "", &amp;lt;&amp;lt;Set Width( 700 ) ),
            Outline Box( "Program Name" ),
            Text Edit Box( "", &amp;lt;&amp;lt;Set Width( 700 ) ),
            Outline Box( "Measurement Equipment" ),
            Text Edit Box( "", &amp;lt;&amp;lt;Set Width( 700 ) ),
            Outline Box( "Comments" ),
            Text Edit Box( "


", &amp;lt;&amp;lt;Set Width( 700 ) ),
            Outline Box( "Signature &amp;amp; Date" ),
            Text Edit Box( "


", &amp;lt;&amp;lt;Set Width( 700 ) )
        ), 

        Text Box( " " )
    ), 

    dt = Current Data Table();
    obj = Variability Chart(
        Ignore Platform Preferences( 1 ),
        Model( "Crossed" ),
        Historical Sigma( 0 ),
        Connect Cell Means( 1 ),
        Mean of Std Dev( 1 ),
        Name( "Reduced Gauge R&amp;amp;R Report" )(1),
        Name( "Gauge R&amp;amp;R" )(6, 0.24),
        Name( "Gauge R&amp;amp;R Report" )(1),
        Misclassification Probabilities( 0 ),
        Variance Components( 0 ),
        Mean Plots( 1 ),
        Std Dev Plots( 1 ),
        Automatic Recalc( 1 ), 

    );
);
//if(OK button = run / No Ok wait(1));
dt1 = Current Report()[Outline Box( "Variability Gauge" )][Outline Box( "Gauge R&amp;amp;R" )][Table Box( 2 )] &amp;lt;&amp;lt;
Make combined Data Table;
Wait( 10 );
dt1 &amp;lt;&amp;lt; Set name( "GRR1.jmp" );
Data Table( "GRR1.jmp" );
:Y &amp;lt;&amp;lt; Set Name( "# Number" );
Data Table( "GRR1.jmp" );
Column( 2 ) &amp;lt;&amp;lt; Set Name( "Results" );
Data Table( "GRR1.jmp" );
Column( 3 ) &amp;lt;&amp;lt; Set Name( "Data" );
Data Table( "GRR1" ) &amp;lt;&amp;lt; Split(
    Split By( :Data ),
    Split( :Results ),
    Group( :Name( "# Number" ) ),
    Sort by Column Property
);
dt2 = Current Data Table();
dt2 &amp;lt;&amp;lt; Set name( "GRR2.jmp" );
Data Table( "GRR2" ) &amp;lt;&amp;lt; Subset(
    All rows,
    columns( :Name( "# Number" ), :k, :Name( "Precision/Tolerance Ratio = RR/(USL-LSL)" ) )
);
dt3 = Current Data Table();
dt3 &amp;lt;&amp;lt; Set name( "GRR3.jmp" );
Data Table( "GRR3.jmp" );
Column( 3 ) &amp;lt;&amp;lt; Set Name( "PT Ratio" );
Data Table( "GRR3.jmp" );
New Column( "PT Ratio Result",
    Character,
    "Nominal",
    Set Property( "Value Colors", {"Accepted" = 4, "Not Accepted" = 19, "Partly Accepted" = 41} ),
    Formula( If( :PT Ratio &amp;lt;= 0.3, If( :PT Ratio &amp;lt;= 0.1, "Accepted", "Partly Accepted" ), "Not Accepted" ) ),
    Color Cell by Value,
    Set Selected,
    Set Display Width( 200 )
);
Close( "GRR1.jmp", No Save );
Close( "GRR2.jmp", No Save );
Data Table( "GRR3.jmp" ) &amp;lt;&amp;lt; Sort( By( :Name( "# Number" ) ), Order( Ascending ), Output Table( "GRR Report" ) );
Close( "GRR3.jmp", No Save );
Data Table( "GRR Report.jmp" ):PT Ratio &amp;lt;&amp;lt; Format( "Fixed Dec", 20, 2 );
Data Table( "GRR Report.jmp" ) &amp;lt;&amp;lt; Select Columns( all );
dt = Data Table( "GRR Report.jmp" );
Get Window( nw )[Text Box( 9 )] &amp;lt;&amp;lt; Sib Append( H List Box( Outline Box( "GRR Report", dt &amp;lt;&amp;lt; Get As Report ) ) );
nw[Table Box( 1 )] &amp;lt;&amp;lt; Set Scrollable( 0, 0 );

wlist = Get Window List() &amp;lt;&amp;lt; Get Window Title();
choose_window = Function( {},
    win = New Window( "Select a Report",
        &amp;lt;&amp;lt;Modal,
        hb = H List Box(
            Panel Box( "Select a report window",
                tcf = List Box( wlist, Max Selected( 1 ), chosen = tcf &amp;lt;&amp;lt; Get Selected() )
            ), 

        )
    );
    chosen;
);
chosen = choose_window();
w = Window( chosen[1] );
w &amp;lt;&amp;lt; Report;
//you might need to scale the report to fit in the pdf page
w &amp;lt;&amp;lt; Set page setup( margins( 0.2, 0.5, 0.2, 0.5 ), scale( .75 ), Landscape( 1 ), paper size( "A4" ) );
path = Pick Directory( "Select a directory" );
Set Default Directory( path );
w &amp;lt;&amp;lt; Save Interactive HTML();
w &amp;lt;&amp;lt; Set page setup( margins( 0.2, 0.5, 0.2, 0.5 ), scale( .75 ), Landscape( 1 ), paper size( "A4" ) );
w &amp;lt;&amp;lt; save pdf();
Data Table( "GRR Report" ) &amp;lt;&amp;lt; save( "" );
nt = Current Data Table();
nt &amp;lt;&amp;lt; Save();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:03:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-my-script-to-wait-for-platform-to-finish/m-p/278110#M54020</guid>
      <dc:creator>Jakob</dc:creator>
      <dc:date>2023-06-11T11:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Getting my script to wait for platform to finish</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-my-script-to-wait-for-platform-to-finish/m-p/278521#M54084</link>
      <description>&lt;P&gt;I believe one of these approaches will help here:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="How to button press and wait until action is finished" uid="237183" url="https://community.jmp.com/t5/Discussions/How-to-button-press-and-wait-until-action-is-finished/m-p/237183#U237183" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-MESSAGE title="delay script execution until user input is provided?" uid="7528" url="https://community.jmp.com/t5/Discussions/delay-script-execution-until-user-input-is-provided/m-p/7528#U7528" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2020 18:28:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-my-script-to-wait-for-platform-to-finish/m-p/278521#M54084</guid>
      <dc:creator>martindemel</dc:creator>
      <dc:date>2020-07-14T18:28:11Z</dc:date>
    </item>
  </channel>
</rss>

