<?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 Save all scripts and close reports by JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Save-all-scripts-and-close-reports-by-JSL/m-p/280481#M54337</link>
    <description>&lt;P&gt;Trying to write a script for this I found the following below working. &lt;A href="mailto:JMP15@Win10" target="_blank"&gt;JMP15@Win10&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;The first part opens two tables and starts some Reports,&lt;/P&gt;&lt;P&gt;and the second Closes all report Windows post saving scripts to belonging tables.&lt;/P&gt;&lt;P&gt;But when the report has a local datafilter, the script is not working any more (get scriptable object doesn't get the Right reference).&lt;/P&gt;&lt;P&gt;Is there a way to find proper reference for each report window, to save the script and close the report? - Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Preparation
Names Default To Here( 1 );
dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );
dis = dt1 &amp;lt;&amp;lt; run script( "Distribution" );
biv = dt1 &amp;lt;&amp;lt; run script( "Bivariate" );
one = dt1 &amp;lt;&amp;lt; run script( "Oneway" );

dt2 = Open( "$SAMPLE_DATA/Membrane.jmp" );
one2 = dt2 &amp;lt;&amp;lt; run script( "Oneway" );

lst_scr = dt1 &amp;lt;&amp;lt; Get Table Script Names;
dt1 &amp;lt;&amp;lt; Delete Scripts( lst_scr );  // delete all scripts
lst_scr = dt2 &amp;lt;&amp;lt; Get Table Script Names;
dt2 &amp;lt;&amp;lt; Delete Scripts( lst_scr );  // delete all scripts
Wait( 5 );

// Script performance
Names default to here(1);
win_lst = Get Window List( Type( "Reports" ) );
For( i = 1, i &amp;lt;= N Items( win_lst ), i++,
	obj = win_lst[i][Outline Box( 1 )] &amp;lt;&amp;lt; get scriptable object;
	obj &amp;lt;&amp;lt; save script to data table;
	obj &amp;lt;&amp;lt; close window;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 09 Jun 2023 23:32:40 GMT</pubDate>
    <dc:creator>Georg</dc:creator>
    <dc:date>2023-06-09T23:32:40Z</dc:date>
    <item>
      <title>Save all scripts and close reports by JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Save-all-scripts-and-close-reports-by-JSL/m-p/280481#M54337</link>
      <description>&lt;P&gt;Trying to write a script for this I found the following below working. &lt;A href="mailto:JMP15@Win10" target="_blank"&gt;JMP15@Win10&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;The first part opens two tables and starts some Reports,&lt;/P&gt;&lt;P&gt;and the second Closes all report Windows post saving scripts to belonging tables.&lt;/P&gt;&lt;P&gt;But when the report has a local datafilter, the script is not working any more (get scriptable object doesn't get the Right reference).&lt;/P&gt;&lt;P&gt;Is there a way to find proper reference for each report window, to save the script and close the report? - Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Preparation
Names Default To Here( 1 );
dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );
dis = dt1 &amp;lt;&amp;lt; run script( "Distribution" );
biv = dt1 &amp;lt;&amp;lt; run script( "Bivariate" );
one = dt1 &amp;lt;&amp;lt; run script( "Oneway" );

dt2 = Open( "$SAMPLE_DATA/Membrane.jmp" );
one2 = dt2 &amp;lt;&amp;lt; run script( "Oneway" );

lst_scr = dt1 &amp;lt;&amp;lt; Get Table Script Names;
dt1 &amp;lt;&amp;lt; Delete Scripts( lst_scr );  // delete all scripts
lst_scr = dt2 &amp;lt;&amp;lt; Get Table Script Names;
dt2 &amp;lt;&amp;lt; Delete Scripts( lst_scr );  // delete all scripts
Wait( 5 );

// Script performance
Names default to here(1);
win_lst = Get Window List( Type( "Reports" ) );
For( i = 1, i &amp;lt;= N Items( win_lst ), i++,
	obj = win_lst[i][Outline Box( 1 )] &amp;lt;&amp;lt; get scriptable object;
	obj &amp;lt;&amp;lt; save script to data table;
	obj &amp;lt;&amp;lt; close window;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:32:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Save-all-scripts-and-close-reports-by-JSL/m-p/280481#M54337</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2023-06-09T23:32:40Z</dc:date>
    </item>
  </channel>
</rss>

