<?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 Re: Is there an easy way open a script generated graph with the script name as a title? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/545585#M76393</link>
    <description>&lt;P&gt;I hope that I understand what you are asking. This script illustrates one way that might work. The first part is just a way to have some open (data table and Graph Builder) for which the rest of the script to work. That is the part that you might use with your own open Graph Builder objects. You could save this script as an add-in so then it is just a matter of selecting a menu command when you want to use it.&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 );

// example of Graph Builder
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 534, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :height ), Y( :weight ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);

// now the script to save table script with desired name

// ask user for name of script
dialog = New Window( "Name of Script", &amp;lt;&amp;lt; Modal,
	Panel Box( "Script Name",
		Line Up Box( N Col( 2 ),
			Text Box( "Name:" ),
			teb = Text Edit Box( "Graph Builder Script" )
		),
		H List Box(
			Button Box( "OK",
				name = teb &amp;lt;&amp;lt; Get Text;
			),
			Button Box( "Cancel" )
		)
	)
);
If( dialog["Button"] == -1, Throw( "User cancelled" ) );

// save script for current instance of Graph Builder
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], "Graph Builder" ),
		Break();
	);
);
obj = window[i]["Graph Builder"] &amp;lt;&amp;lt; Get Scriptable Object;
obj &amp;lt;&amp;lt; Save Script to Data Table( name, &amp;lt;&amp;lt; Prompt( 0 ), &amp;lt;&amp;lt; Replace( 1 ) );

// update table script
script = dt &amp;lt;&amp;lt; Get Property( name );
Eval(
	Substitute(
		Expr(
			dt &amp;lt;&amp;lt; Set Property( nnn,
				w = sss;
				w &amp;lt;&amp;lt; Set Window Title( nnn )
			)
		),
		Expr( sss ), Name Expr( script ),
		Expr( nnn ), name
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 16 Sep 2022 16:58:56 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2022-09-16T16:58:56Z</dc:date>
    <item>
      <title>Is there an easy way open a script generated graph with the script name as a title?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/532220#M75523</link>
      <description>&lt;P&gt;Hi, I often find myself saving a few scripts that used the same application (e.g. Graph builder) to a datatable. When you run these scripts the window title of the graph will automatically be "Datatable - graph builder".&lt;/P&gt;&lt;P&gt;When multiple scripts are run this creates the situation of having windows open with titles "Graph Builder 2", "Graph Builder 3" and I lose track of which script generated which window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been using a code around my script like below example, however when I make a few changes I cannot simply perform the "save script to datatable" option without overwriting this naming convention.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;w = Graph Builder(
// graph script
);
w &amp;lt;&amp;lt; set window title( "script name" )&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;Example: script opens a window with generic "Graph builder" title.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mvanderaa1_0-1660116956611.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44692i09C662F35F636121/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mvanderaa1_0-1660116956611.png" alt="mvanderaa1_0-1660116956611.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:26:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/532220#M75523</guid>
      <dc:creator>mvanderaa1</dc:creator>
      <dc:date>2023-06-11T11:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an easy way open a script generated graph with the script name as a title?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/532247#M75525</link>
      <description>&lt;P&gt;If your question is, "how do I save a script to the data table with a specified name?" &amp;nbsp;Then I think I have an answer for you.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;
dt=current data table();

obj=dt&amp;lt;&amp;lt;Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :Temp ), Y( :pH ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Ellipse( X, Y, Legend( 5 ) ) )
);
//  app&amp;lt;&amp;lt;save script to data table ( &amp;lt;name&amp;gt; , &amp;lt; &amp;lt;&amp;lt;prompt(0|1)&amp;gt;, &amp;lt; &amp;lt;&amp;lt;Replace(0|1)&amp;gt; );
obj &amp;lt;&amp;lt; Save Script to Data Table("New GB");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;...but I'm not sure if that was what you were asking?&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 08:15:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/532247#M75525</guid>
      <dc:creator>Byron_JMP</dc:creator>
      <dc:date>2022-08-10T08:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an easy way open a script generated graph with the script name as a title?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/533573#M75648</link>
      <description>&lt;P&gt;Hi Byron, that was not what I was asking. I'm looking for the window name that is opened to have the script name. Like I said I can do it once by adding below code around my script. But my problem then is that I cannot alter my graphs (e.g. change axes and visuals) without having to copy/paste the new graph script into my datatable script.&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;w = Graph Builder(
// graph script
);
w &amp;lt;&amp;lt; set window title( "script name" )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mvanderaa1_0-1660545123241.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44784i8A552D2E3092B025/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mvanderaa1_0-1660545123241.png" alt="mvanderaa1_0-1660545123241.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just tried a method of creating a second script that runs the graph builder script and changes the window name. This is basically what I want because I can make changes to the graph and "save to datatable" again, overwriting my original graph. I don't need any copy/pasting anymore. See "big class 2.jmp" in attachments, I would just run the "run myGraph1" script. It would be nice of course if I wouldn't need the second script to initiate my graph script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2022 06:50:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/533573#M75648</guid>
      <dc:creator>mvanderaa1</dc:creator>
      <dc:date>2022-08-15T06:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an easy way open a script generated graph with the script name as a title?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/533863#M75659</link>
      <description>&lt;P&gt;Is this what you are looking for?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;w &amp;lt;&amp;lt; get window title()&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Aug 2022 14:55:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/533863#M75659</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2022-08-15T14:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an easy way open a script generated graph with the script name as a title?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/537712#M75905</link>
      <description>&lt;P&gt;What if instead of changing the window title you just changed the name of the outline box in that window?&amp;nbsp; You can do that by double clicking on the name, and that is maintained in the saved script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ih_0-1661514076331.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45016i620A0E114AFB0B24/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ih_0-1661514076331.png" alt="ih_0-1661514076331.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;A sidebar: this might be moving farther away from changing graphs without copy/pasting, but if you have a bunch of graphs that you often look at for a dataset, you might consider building a dashboard or window that contains all of them, with some headings and text to give each context.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 11:44:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/537712#M75905</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2022-08-26T11:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an easy way open a script generated graph with the script name as a title?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/545220#M76374</link>
      <description>&lt;P&gt;I suppose the behaviour I'm struggling with can be circumvented by using a dashboard indeed. I'll try to adapt my way of working in JMP.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 07:16:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/545220#M76374</guid>
      <dc:creator>mvanderaa1</dc:creator>
      <dc:date>2022-09-16T07:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an easy way open a script generated graph with the script name as a title?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/545222#M76375</link>
      <description>&lt;P&gt;Based on the feedback in this thread, I conclude that there is no easy way to do this in JMP.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 07:19:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/545222#M76375</guid>
      <dc:creator>mvanderaa1</dc:creator>
      <dc:date>2022-09-16T07:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an easy way open a script generated graph with the script name as a title?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/545585#M76393</link>
      <description>&lt;P&gt;I hope that I understand what you are asking. This script illustrates one way that might work. The first part is just a way to have some open (data table and Graph Builder) for which the rest of the script to work. That is the part that you might use with your own open Graph Builder objects. You could save this script as an add-in so then it is just a matter of selecting a menu command when you want to use it.&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 );

// example of Graph Builder
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size( 534, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :height ), Y( :weight ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);

// now the script to save table script with desired name

// ask user for name of script
dialog = New Window( "Name of Script", &amp;lt;&amp;lt; Modal,
	Panel Box( "Script Name",
		Line Up Box( N Col( 2 ),
			Text Box( "Name:" ),
			teb = Text Edit Box( "Graph Builder Script" )
		),
		H List Box(
			Button Box( "OK",
				name = teb &amp;lt;&amp;lt; Get Text;
			),
			Button Box( "Cancel" )
		)
	)
);
If( dialog["Button"] == -1, Throw( "User cancelled" ) );

// save script for current instance of Graph Builder
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], "Graph Builder" ),
		Break();
	);
);
obj = window[i]["Graph Builder"] &amp;lt;&amp;lt; Get Scriptable Object;
obj &amp;lt;&amp;lt; Save Script to Data Table( name, &amp;lt;&amp;lt; Prompt( 0 ), &amp;lt;&amp;lt; Replace( 1 ) );

// update table script
script = dt &amp;lt;&amp;lt; Get Property( name );
Eval(
	Substitute(
		Expr(
			dt &amp;lt;&amp;lt; Set Property( nnn,
				w = sss;
				w &amp;lt;&amp;lt; Set Window Title( nnn )
			)
		),
		Expr( sss ), Name Expr( script ),
		Expr( nnn ), name
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Sep 2022 16:58:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/545585#M76393</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2022-09-16T16:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an easy way open a script generated graph with the script name as a title?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/718115#M90010</link>
      <description>&lt;P&gt;If I wanted to run something similar for a oneway plot, how can I modify this?&amp;nbsp; Replacing "Graph Builder" with "Oneway" doesn't seem to work.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 16:45:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/718115#M90010</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2024-01-22T16:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an easy way open a script generated graph with the script name as a title?</title>
      <link>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/721434#M90351</link>
      <description>&lt;P&gt;With some help from a colleague (Thanks Andrew!) , we came up with this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;clear Globals();
Delete Symbols();
// save script for current instance of Fit Group
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], "Fit Y by X" ),
	
		obj = window[i]["Fit Group?"] &amp;lt;&amp;lt; Get Scriptable Object;
		Show(obj);
		obj &amp;lt;&amp;lt; Save Script for All Objects;
Break();
	);
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Can be adapted to grab the script for any kind of a graph by substituting the items in quotes.&amp;nbsp; The ability to use a ? as a wildcard in a matrix is priceless.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 22:10:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Is-there-an-easy-way-open-a-script-generated-graph-with-the/m-p/721434#M90351</guid>
      <dc:creator>SpannerHead</dc:creator>
      <dc:date>2024-02-01T22:10:30Z</dc:date>
    </item>
  </channel>
</rss>

