<?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: Bug or Feature?? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/676655#M86327</link>
    <description>&lt;P&gt;Note that I've only seen the issue when the ^Q causes the below popup (multiple unsaved files) and the user clicks "Save None"&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="ErraticAttack_0-1694485154590.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56497i6239E4F3C3382B87/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ErraticAttack_0-1694485154590.png" alt="ErraticAttack_0-1694485154590.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2023 02:20:00 GMT</pubDate>
    <dc:creator>ErraticAttack</dc:creator>
    <dc:date>2023-09-12T02:20:00Z</dc:date>
    <item>
      <title>Bug or Feature??</title>
      <link>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/673589#M86105</link>
      <description>&lt;P&gt;Quick question for those of you who may know -- if you have an &amp;lt;&amp;lt;On Close() method for a window (say for file-cleanup or some such thing), and a user has multiple edited files open -- if they CTRL-Q and get the popup about unsaved work -- if they then click "Save None", then all windows are immediately killed and the &amp;lt;&amp;lt;On Close() script is _NOT_ called for any of the windows.&amp;nbsp; It is&amp;nbsp;&lt;STRONG&gt;extremely&lt;/STRONG&gt; common for users to exit JMP this way, thus pretty much always bypassing all &amp;lt;&amp;lt;On Close() scripts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anyone seen this / aware of any work-arounds?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The main problem I'm running into is that I have JMP launch an event-loop Python script and attach the executable to a window, then I communicate to Python via localhost sockets.&amp;nbsp; The window close script will terminate the Python session gracefully and such.&amp;nbsp; When JMP is closed in the manner above, this doesn't happen and JMP then freezes, but the JMP windows are all gone -- so JMP remains in the Task Manager list with its full set of resources (often more than 1GB) and will only be killed by manually ending the task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since the RunProgram result must be tied to an active JMP window (for event-loop purposes I suppose), and since the window gets forcibly closed in the manner I describe above, the RunProgram variable gets destroyed before I'm able to properly shut down Python.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a mess and one for which I wish had a solution, but as of yet I'm not seeing it.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 00:40:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/673589#M86105</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2023-09-02T00:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Bug or Feature??</title>
      <link>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/673679#M86115</link>
      <description>&lt;P&gt;I used this in the FileSnapper addin to deal with similar issues. RunProgram isn't actually tied to a window, but to the window's context, which can be cloned. As long as a clone or the window refers to the context, it won't be destroyed and the RunProgram scripts will still work. The namespace:evalcontext variable isn't ever used, except to keep the context alive. The RunProgram variable/handle (rp maybe) is also kept in the same namespace because it needs the same lifetime.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// addinLoad.jsl - this is the round-about launcher that uses a clone of a transient
// window's evalcontextbox to keep the evalcontext for a callback script alive.
// ideally, this would be, or directly include, FileSnapper.jsl, but that file 
// constructs a RunProgram callback script that is somehow tied to a transient
// evalcontext that won't be available at callback time.
Local( {bb},
	New Window( "File Snapper Startup", bb = Button Box( "start", Include( "$ADDIN_HOME(com.jmp.hales.FileSnapper)\Additional.jsl" ) ) );
	bb &amp;lt;&amp;lt; click; // run the script in this window's context
	// capture the evalcontext, by cloning the box that references it into our namespace
	Namespace( "FileSnapper" ):evalcontext = ((bb &amp;lt;&amp;lt; parent) &amp;lt;&amp;lt; parent) &amp;lt;&amp;lt; clonebox;
	bb &amp;lt;&amp;lt; closewindow;
	if(Namespace( "FileSnapper" ):evalcontext&amp;lt;&amp;lt;classname!="EvalContextBox",throw("FileSnapper addinLoad needs EvalContextBox, got "||(((bb &amp;lt;&amp;lt; parent) &amp;lt;&amp;lt; parent)&amp;lt;&amp;lt;classname)));
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;None of that is documented or promised to work in the future, but it will probably throw a helpful message if something changes.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/1492"&gt;@jschroedl&lt;/a&gt;&amp;nbsp; - ^Q and OnClose scripts&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 14:05:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/673679#M86115</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2023-09-02T14:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Bug or Feature??</title>
      <link>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/673706#M86119</link>
      <description>&lt;P&gt;Thank you for this!&amp;nbsp; I'll be taking a look at it now and see if it works, but you never fail to give these wonderful gems, so I'm sure it will work for me!&amp;nbsp; This will be awesome for bypassing the window issue!&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 21:31:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/673706#M86119</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2023-09-02T21:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Bug or Feature??</title>
      <link>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/675877#M86269</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/50332"&gt;@KennethAdams&lt;/a&gt;&amp;nbsp; You're welcome! &lt;LI-MESSAGE title="FileSnapper" uid="321870" url="https://community.jmp.com/t5/Uncharted/FileSnapper/m-p/321870#U321870" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-blog-thread lia-fa-icon lia-fa-blog lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt; ( &lt;LI-MESSAGE title="FileSnapper" uid="321872" url="https://community.jmp.com/t5/JMP-Add-Ins/FileSnapper/m-p/321872#U321872" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt; ), or the technique to grab the context? Either feedback is good for JMP dev team.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2026"&gt;@jules&lt;/a&gt;&amp;nbsp; - Filesnapper might help recover JSL I'm working on, and the context grabber is useful when writing add-ins that launch during startup (and maybe elsewhere.) Both ideas could be better if more integrated into JMP.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2023 15:03:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/675877#M86269</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2023-09-08T15:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Bug or Feature??</title>
      <link>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/676559#M86320</link>
      <description>&lt;P&gt;Thanks for the heads-up here&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have filed an issue to investigate the ^Q + OnClose behavior to see if we can improve things in the future.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 18:54:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/676559#M86320</guid>
      <dc:creator>jschroedl</dc:creator>
      <dc:date>2023-09-11T18:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Bug or Feature??</title>
      <link>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/676655#M86327</link>
      <description>&lt;P&gt;Note that I've only seen the issue when the ^Q causes the below popup (multiple unsaved files) and the user clicks "Save None"&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="ErraticAttack_0-1694485154590.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/56497i6239E4F3C3382B87/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ErraticAttack_0-1694485154590.png" alt="ErraticAttack_0-1694485154590.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 02:20:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/676655#M86327</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2023-09-12T02:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Bug or Feature??</title>
      <link>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/676924#M86342</link>
      <description>&lt;P&gt;I just finished implementing a persistent Python connection using your trick to get rid of the window -- I can now put the Python session termination script within the AddinUnload.jsl file and it works (JMP doesn't freeze with no windows open, leaving a hidden session that can only be killed via TaskManager)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much for your help!&amp;nbsp; With the new persistent Python connection I can offload all of my data-queries to Python and run them in parallel, then JMP will pick up the files when ready for the user to consume, it's great!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 14:10:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/676924#M86342</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2023-09-12T14:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Bug or Feature??</title>
      <link>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/711361#M89488</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/1492"&gt;@jschroedl&lt;/a&gt;&amp;nbsp;has there been an update with this?&amp;nbsp; I'm also noticing the same issue when a user selects multiple windows from the Window List and closes them all at once (usually by pressing Delete after selecting them) and if there is a popup about multiple unsaved files, the Save None will close without triggering the OnClose -- exactly the same as above except they're not quitting JMP.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This can leave many resources dangling as the cleanup scripts never run.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Dec 2023 21:06:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bug-or-Feature/m-p/711361#M89488</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2023-12-20T21:06:39Z</dc:date>
    </item>
  </channel>
</rss>

