<?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 Script to Edit a Script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825766#M100622</link>
    <description>&lt;P&gt;I have a script that takes a standard contour plot output and rearranges the plots into columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Goes from&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SpannerHead_0-1735914715797.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71658i0ADDEB5A1813F2CC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SpannerHead_0-1735914715797.png" alt="SpannerHead_0-1735914715797.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SpannerHead_1-1735914961605.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71659i8DABFB70342BD633/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SpannerHead_1-1735914961605.png" alt="SpannerHead_1-1735914961605.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The placement of the text boxes is causing the script to misfire.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a different way to get the result?&amp;nbsp; If not, can I adjust the present script somehow to sort it?&amp;nbsp; I was wondering if the parent script could execute a find/replace on the child script to perform some adjustments?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;clear Globals();
Delete Symbols();
window = Get Window List();
wName = window &amp;lt;&amp;lt; Get Window Title;
nWindows = N Items( window );
For( i = nWindows, i &amp;gt; 0, i--,
	If( Contains( wName[i], "Contour Plot" ),
	
		obj = window[i]["Contour Plot?"] &amp;lt;&amp;lt; Get Scriptable Object;
		Show(obj);
		obj &amp;lt;&amp;lt; Save Script for All Objects;
obj &amp;lt;&amp;lt; Close Window;
Break();
	);
);
spt = Window( "Script Window" );
spt &amp;lt;&amp;lt; Bring Window To Front;
spt2 = spt[Script Box(1)];
spt2 &amp;lt;&amp;lt; Get Line Text( 3 );
spt2 &amp;lt;&amp;lt; Set Line Text (3, "Line Up Box( N Col( 3 ), Spacing( 2 ),");
spt2 &amp;lt;&amp;lt; run();
spt2 &amp;lt;&amp;lt; Close Window;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jan 2025 14:40:34 GMT</pubDate>
    <dc:creator>SpannerHead</dc:creator>
    <dc:date>2025-01-03T14:40:34Z</dc:date>
    <item>
      <title>Script to Edit a Script</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825766#M100622</link>
      <description>&lt;P&gt;I have a script that takes a standard contour plot output and rearranges the plots into columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Goes from&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SpannerHead_0-1735914715797.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71658i0ADDEB5A1813F2CC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SpannerHead_0-1735914715797.png" alt="SpannerHead_0-1735914715797.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SpannerHead_1-1735914961605.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71659i8DABFB70342BD633/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SpannerHead_1-1735914961605.png" alt="SpannerHead_1-1735914961605.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The placement of the text boxes is causing the script to misfire.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a different way to get the result?&amp;nbsp; If not, can I adjust the present script somehow to sort it?&amp;nbsp; I was wondering if the parent script could execute a find/replace on the child script to perform some adjustments?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;clear Globals();
Delete Symbols();
window = Get Window List();
wName = window &amp;lt;&amp;lt; Get Window Title;
nWindows = N Items( window );
For( i = nWindows, i &amp;gt; 0, i--,
	If( Contains( wName[i], "Contour Plot" ),
	
		obj = window[i]["Contour Plot?"] &amp;lt;&amp;lt; Get Scriptable Object;
		Show(obj);
		obj &amp;lt;&amp;lt; Save Script for All Objects;
obj &amp;lt;&amp;lt; Close Window;
Break();
	);
);
spt = Window( "Script Window" );
spt &amp;lt;&amp;lt; Bring Window To Front;
spt2 = spt[Script Box(1)];
spt2 &amp;lt;&amp;lt; Get Line Text( 3 );
spt2 &amp;lt;&amp;lt; Set Line Text (3, "Line Up Box( N Col( 3 ), Spacing( 2 ),");
spt2 &amp;lt;&amp;lt; run();
spt2 &amp;lt;&amp;lt; Close Window;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 14:40:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825766#M100622</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2025-01-03T14:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: Script to Edit a Script</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825781#M100624</link>
      <description>&lt;P&gt;If you can use JMP18 you can just modify the layout from the highest level red triangle&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1735919444431.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71663iC107115F80CCBA69/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1735919444431.png" alt="jthi_0-1735919444431.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't have access to JMP17 anymore and I'm not sure if I can even get similar result in JMP18 to test out different options but you could take those text boxes into account (increase ncol to 6 and hide them / keep ncol as 3 and remove them). You could also determine which column is being used as the by column and rebuild the platform using that information WITHOUT using By (run it multiple times and format as you want to).&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 15:59:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825781#M100624</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-01-03T15:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Script to Edit a Script</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825782#M100625</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;current report()["Conto?"]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;thanks, very useful :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 16:54:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825782#M100625</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-01-03T16:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script to Edit a Script</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825794#M100627</link>
      <description>&lt;P&gt;You could collect the scripts of the &lt;FONT face="courier new,courier"&gt;OutlineBoxes&lt;/FONT&gt;, encapsulate every (&lt;FONT face="courier new,courier"&gt;Where&lt;/FONT&gt; information + plot)&amp;nbsp; inside a&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;V List Box&lt;/FONT&gt;&amp;nbsp;and arrange the &lt;FONT face="courier new,courier"&gt;V List Boxes&lt;/FONT&gt; via the &lt;FONT face="courier new,courier"&gt;Lineup Box&lt;/FONT&gt; :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// ask every Outline Box for a scriptable object
obs = (current report() &amp;lt;&amp;lt; xpath("//OutlineBox")) &amp;lt;&amp;lt; get scriptable object;

// ask the scriptable objects for a script
scripts = obs  &amp;lt;&amp;lt; get Script;

// prepare a template LineUp Box
myExpr = Expr( Line Up Box( N Col( 3 ), Spacing( 2 )));

// wrap the scripts with V List Box and put them into the template
For each({script}, scripts, 
Eval (Substitute(Expr(Insert Into(myExpr, Expr(V list Box (_content_)))), Expr(_content_), Name Expr(script)))
);

// use the template in a new window
New Window("overview", myExpr);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 22:34:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825794#M100627</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-01-03T22:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Script to Edit a Script</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825798#M100630</link>
      <description>&lt;P&gt;Closer to the original approach with the ...&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Script for all Objects:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// there is no
// myScript =  (current report()[OutlineBox(1)] &amp;lt;&amp;lt; get scriptable object) &amp;lt;&amp;lt;  get Script for All Objects;
// : (

(current report()[OutlineBox(1)] &amp;lt;&amp;lt; get scriptable object) &amp;lt;&amp;lt;  save Script for All Objects;
sw = Window( "Script Window" );
myScript = Parse(sw[Script Box(1)] &amp;lt;&amp;lt; get text);

//--------------------------
&lt;BR /&gt;// prepare a Template for the Line Up Box
myExpr = Expr( Line Up Box( N Col( 3 ), Spacing( 2 )));&lt;BR /&gt;
// take the V list Box - it contains the Countour Plot commands
myScript = (Extract Expr(myScript, V List Box (Wild List())));

// cycle through Contour Plot commands, "wrap" with V List Box and insert into template
For each({command}, Name Expr(myScript), // an I-DONT-CARE of VLBs
    wrapped = Insert (Expr(V list Box ()), Name Expr(command));
	Insert Into(myExpr, Name Expr(wrapped))
);

// generate the report
New Window("overview", myExpr);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many many Thanks to the programmer of the&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;For Each&lt;/FONT&gt;&amp;nbsp;function !!&amp;nbsp;&lt;BR /&gt;wonderful : )&lt;BR /&gt;It works with any &lt;FONT face="courier new,courier"&gt;Expression&lt;/FONT&gt;, not just with &lt;FONT face="courier new,courier"&gt;List, Associative Array and Matrix&lt;/FONT&gt;&amp;nbsp;: )&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1735929022906.png" style="width: 664px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71665i574061A898F0F844/image-dimensions/664x102?v=v2" width="664" height="102" role="button" title="hogi_0-1735929022906.png" alt="hogi_0-1735929022906.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2025 07:48:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825798#M100630</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-01-04T07:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Script to Edit a Script</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825837#M100642</link>
      <description>&lt;P&gt;I have done this a little different.&amp;nbsp; I generated the contour plots from the Semiconductor Capability data table, and then ran the following script&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Globals();
Delete Symbols();
window = Get Window List();
wName = window &amp;lt;&amp;lt; Get Window Title;
nWindows = N Items( window );
For( i = nWindows, i &amp;gt; 0, i--,
	If( Contains( wName[i], "Contour Plot" ), 
		obj = window[i]["Contour Plot?"] &amp;lt;&amp;lt; Get Scriptable Object;
		Break();
	)
);

script = Char( obj &amp;lt;&amp;lt; get bygroup script );
obj &amp;lt;&amp;lt; Close Window;
Eval( Parse( "New Window(\!"Contours\!",lineupbox(ncol(3), spacing(2)," || script || "));" ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to get this output&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1735960939603.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71673i857DA50525B6658E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1735960939603.png" alt="txnelson_0-1735960939603.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2025 03:22:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825837#M100642</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-01-04T03:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Script to Edit a Script</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825850#M100644</link>
      <description>&lt;P&gt;Ah, right, the &lt;FONT face="courier new,courier"&gt;get bygroup script()&lt;/FONT&gt; was already there. Indeed, much easier this way : )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;(current report()["Contour?"] &amp;lt;&amp;lt; get scriptable object) &amp;lt;&amp;lt; get by group script&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is quite robust.&lt;/P&gt;&lt;P&gt;It works with JMP17 (talking to the first plot)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1735970665960.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71674i400CAF50FBA49EF9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1735970665960.png" alt="hogi_0-1735970665960.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;... and JMP18 (talking to the Group Platform):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1735970726383.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71675i4DD1D27E6079DE84/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1735970726383.png" alt="hogi_1-1735970726383.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you use the return value of the report command, you have to be careful to get the script only 1x:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;cp =Contour Plot( ... ,By() ); // returns a list
//cp &amp;lt;&amp;lt; get script; // 1 script per plot (N times, message sent to a list)&lt;BR /&gt;// cp &amp;lt;&amp;lt; get bygroup script; // returns the by group Script N times (message sent to a list)
cp[1] &amp;lt;&amp;lt; get bygroup script; //&amp;nbsp;1x&amp;nbsp;:)&lt;/img&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2025 06:11:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825850#M100644</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-01-04T06:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Script to Edit a Script</title>
      <link>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825857#M100645</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;... Is quite robust.&amp;nbsp;It works with JMP17 (talking to the first plot)... and JMP18 (talking to the Group Platform)&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Oh, this statement just refers to the way how to get the groupby script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;(current report()["Contour?"] &amp;lt;&amp;lt; get scriptable object) &amp;lt;&amp;lt; get by group script&lt;/CODE&gt;&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;not for the complete thing ...&lt;/P&gt;&lt;P&gt;In JMP 18 and later, the script returns a&amp;nbsp;&lt;FONT face="courier new,courier"&gt;GroupPlatform&lt;/FONT&gt;&amp;nbsp;- and &lt;FONT face="courier new,courier"&gt;Lineup Box&lt;/FONT&gt; is no longer possible to control the layout.&lt;BR /&gt;Then you can skip this outer part and directly use the&amp;nbsp;&lt;FONT face="courier new,courier"&gt;GroupPlatform&lt;/FONT&gt;&amp;nbsp;to control the layout (red triangle options mentioned by&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;).&lt;BR /&gt;&lt;BR /&gt;Tree structure via &lt;FONT face="courier new,courier"&gt;Lineup Box (group by script)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_8-1735975114911.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71682i982032C6544FF942/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_8-1735975114911.png" alt="hogi_8-1735975114911.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;[selected Outlinebox = 1st plot]&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Tree structure via the previous approaches:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_10-1735975604423.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71684iDC1D5CD4452E9E0D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_10-1735975604423.png" alt="hogi_10-1735975604423.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jan 2025 07:26:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-to-Edit-a-Script/m-p/825857#M100645</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-01-04T07:26:55Z</dc:date>
    </item>
  </channel>
</rss>

