<?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: Get &amp;quot;On Close&amp;quot; script? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542968#M76220</link>
    <description>&lt;P&gt;Maybe you could try setting some very simple &amp;lt;&amp;lt; On Close expression just to test it out or use &amp;lt;&amp;lt; On Close expression which will prevent the closing of window, like example from Scripting Index:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
//This message applies to all display box objects
w = Open("$SAMPLE_DATA/Big Class.jmp");
w &amp;lt;&amp;lt; On Close(
	// Modal dialogs return Button(1) if OK is pressed, Button(-1) if canceled
	New Window("Are you sure?",
		&amp;lt;&amp;lt;modal,
		V List Box(
			Text Box("Press OK to allow the window to close"),
			H List Box(Button Box("OK"), Button Box("Cancel"))
		)
	)["button"] == 1
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 09 Sep 2022 16:36:26 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-09-09T16:36:26Z</dc:date>
    <item>
      <title>Get "On Close" script?</title>
      <link>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542691#M76203</link>
      <description>&lt;P&gt;Hi. &amp;nbsp;In JMP there's a way to create a script that automatically executes when the window or table is closed using the "On Close()" command. &amp;nbsp;Is there any way to return the script without executing? &amp;nbsp;That is, I'm looking for a command something like "dt &amp;lt;&amp;lt; Get On Close".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My specifics:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;JMP Pro 16.2.0&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;FONT&gt;macOS Monterey 12.5&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;FONT&gt;Thanks.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:54:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542691#M76203</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2023-06-10T23:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Get "On Close" script?</title>
      <link>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542710#M76204</link>
      <description>&lt;P&gt;In your On Close() function for the given data table, you can use an Include() to bring in a script and run it.&amp;nbsp; If you just want to just get the script, you can use Load Text File().&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 00:56:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542710#M76204</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-09-09T00:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Get "On Close" script?</title>
      <link>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542733#M76205</link>
      <description>&lt;P&gt;After trying a few things, I believe the on close script is write only and Jim's solution is the best choice.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 02:29:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542733#M76205</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-09-09T02:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get "On Close" script?</title>
      <link>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542755#M76206</link>
      <description>&lt;P&gt;Other option would be to evaluate the script into On Close, then you could access it with the saved expression you have&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
//This message applies to all display box objects
dt = Open("$SAMPLE_DATA/Big Class.jmp");
on_close_expr = Expr(Show(1));

Eval(EvalExpr(dt &amp;lt;&amp;lt; On Close(
	Expr(on_close_expr)
)));

Show(Name Expr(on_close_expr));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Sep 2022 06:02:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542755#M76206</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-09-09T06:02:39Z</dc:date>
    </item>
    <item>
      <title>Re: Get "On Close" script?</title>
      <link>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542961#M76218</link>
      <description>&lt;P&gt;Thanks for the suggestions everyone, but allow me to clarify. &amp;nbsp;I have a script that assigns an &amp;lt;&amp;lt; On Close expression to a table, among other things. &amp;nbsp;My issue is that when I subsequently close the table by hand, the on-close expression is not executing the way I intended. &amp;nbsp;As part of my debugging, I'm trying to read back the table's on-close script independently to confirm the script is there. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can already inspect the original on-close expression that I'm assigning to the table in my larger script, but now want to confirm that when the table is closed, JMP sees the same expression I wrote.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 15:42:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542961#M76218</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2022-09-09T15:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get "On Close" script?</title>
      <link>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542965#M76219</link>
      <description>&lt;UL&gt;
&lt;LI&gt;I believe it is write-only. No way to read it back.&lt;/LI&gt;
&lt;LI&gt;I don't think JMP is changing your script.&lt;/LI&gt;
&lt;LI&gt;You might use &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt; idea to make an expression e of the main body, then use &amp;lt;&amp;lt;OnClose( show(char(nameexpr(e))); eval(e); 1 )&lt;/LI&gt;
&lt;LI&gt;If your script depends on globals, you might need to use the evalexpr(...expr(...) ) technique to capture them.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 09 Sep 2022 16:07:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542965#M76219</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-09-09T16:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get "On Close" script?</title>
      <link>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542968#M76220</link>
      <description>&lt;P&gt;Maybe you could try setting some very simple &amp;lt;&amp;lt; On Close expression just to test it out or use &amp;lt;&amp;lt; On Close expression which will prevent the closing of window, like example from Scripting Index:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
//This message applies to all display box objects
w = Open("$SAMPLE_DATA/Big Class.jmp");
w &amp;lt;&amp;lt; On Close(
	// Modal dialogs return Button(1) if OK is pressed, Button(-1) if canceled
	New Window("Are you sure?",
		&amp;lt;&amp;lt;modal,
		V List Box(
			Text Box("Press OK to allow the window to close"),
			H List Box(Button Box("OK"), Button Box("Cancel"))
		)
	)["button"] == 1
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Sep 2022 16:36:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/542968#M76220</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-09-09T16:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get "On Close" script?</title>
      <link>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/574288#M78313</link>
      <description>&lt;P&gt;Hello, thank you for the idea. I can confirm that your suggestion of a dt &amp;lt;&amp;lt; Get On Close will be available in a future version of JMP. (JMP 18 is likely).&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 22:07:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Get-quot-On-Close-quot-script/m-p/574288#M78313</guid>
      <dc:creator>Audrey_Shull</dc:creator>
      <dc:date>2022-11-28T22:07:51Z</dc:date>
    </item>
  </channel>
</rss>

