<?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: How to close App using JSL? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/225355#M44760</link>
    <description>&lt;P&gt;One thing to keep in mind is that every window created by a JMP Application is associated with a Module Instance.&amp;nbsp; In the script for the module, you can do something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(thisModuleInstance &amp;lt;&amp;lt; Get Box) &amp;lt;&amp;lt; Close Window;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could just as well use any of the boxes that define the content of the module.&amp;nbsp; You will see that this approach is used in the sample JMP Application "Launcher With Report".&amp;nbsp; In this example, a launch window is created in one module to collect input, and on "OK" the launch window is closed and the report window is created.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Sep 2019 23:46:28 GMT</pubDate>
    <dc:creator>danschikore</dc:creator>
    <dc:date>2019-09-10T23:46:28Z</dc:date>
    <item>
      <title>How to close App using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/224735#M44663</link>
      <description>&lt;P&gt;All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot find a way to do the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's say I have an App that is in the form of AddIn.&lt;/P&gt;&lt;P&gt;For it to successfully run it needs some conditions met. When they are not I want to create a modal window with description what's needed to run the App and on hitting "OK" button close the App (not JMP though).&lt;/P&gt;&lt;P&gt;How can I close a running App within this App using JSL (I'm going to put it as script to Butotn Box with "OK").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;M.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 22:33:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/224735#M44663</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2019-09-04T22:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to close App using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/224747#M44664</link>
      <description>&lt;P&gt;I typically just close the windows associated with the application&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;obj &amp;lt;&amp;lt; close window;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Sep 2019 23:07:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/224747#M44664</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-09-04T23:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to close App using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/224749#M44665</link>
      <description>&lt;P&gt;Ok, I tried the following:&lt;/P&gt;&lt;P&gt;Created a blank App, default Module1 name. Created one button with the following code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Button1Press=Function({this},
	// This function is called when the button is pressed
	name = this &amp;lt;&amp;lt; Get Button Name;
	show("Trying to close App");
	thisModuleInstance &amp;lt;&amp;lt; Close Window;
	thisApplication &amp;lt;&amp;lt; Close Window;
	Module1 &amp;lt;&amp;lt; Close Window;

);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;None of the three options worked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I get the name of the Application window then?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;M.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 00:28:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/224749#M44665</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2019-09-05T00:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to close App using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/224750#M44666</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;window(" - Application")&amp;lt;&amp;lt; close window;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can specify either the window name, or window number, or if you created the window and have a pointer to the window, you can just pass the &amp;lt;&amp;lt; close window; message to it.&lt;/P&gt;
&lt;P&gt;You can use this little piece of code to find out all of the window names&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;i = 1;
While( Window( i ) &amp;lt;&amp;lt; get window title != {},
	Show( Window( i ) &amp;lt;&amp;lt; get window title );
	i++;
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Sep 2019 00:43:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/224750#M44666</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-09-05T00:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to close App using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/224829#M44677</link>
      <description>&lt;P&gt;The JMP Application has a built-in script that would be a good place for checks like these.&amp;nbsp; The Application workflow is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run Application Script;&lt;/P&gt;
&lt;P&gt;for each module (&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;if (module is autolaunch,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; module&amp;lt;&amp;lt;Create Instance()&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;);&lt;/P&gt;
&lt;P&gt;);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One way to add pre-launch checks for your applications would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Turn off Autolaunch for all modules (select in object panel, toggle off Auto Launch in properties)&lt;/P&gt;
&lt;P&gt;2. On the script tab for the Application:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;okToLaunch = /* insert conditions */&lt;/P&gt;
&lt;P&gt;if (okToLaunch,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;Module1 &amp;lt;&amp;lt; Create Instance,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;/* else show error dialog and exit */&lt;/P&gt;
&lt;P&gt;);&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 13:49:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/224829#M44677</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2019-09-05T13:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to close App using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/225325#M44755</link>
      <description>&lt;P&gt;Thanks! This solves the problem of pre-launch checks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it would still be useful to know how to close an App window.&lt;/P&gt;&lt;P&gt;Closing it by the title as was suggested eariler does not seem to be reliable as title can change (and I do change title in my scripts for various windows).&lt;/P&gt;&lt;P&gt;Is there any way to get a handle on the main App window?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&amp;nbsp;&lt;/P&gt;&lt;P&gt;M&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 18:38:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/225325#M44755</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2019-09-10T18:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to close App using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/225355#M44760</link>
      <description>&lt;P&gt;One thing to keep in mind is that every window created by a JMP Application is associated with a Module Instance.&amp;nbsp; In the script for the module, you can do something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(thisModuleInstance &amp;lt;&amp;lt; Get Box) &amp;lt;&amp;lt; Close Window;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could just as well use any of the boxes that define the content of the module.&amp;nbsp; You will see that this approach is used in the sample JMP Application "Launcher With Report".&amp;nbsp; In this example, a launch window is created in one module to collect input, and on "OK" the launch window is closed and the report window is created.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 23:46:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/225355#M44760</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2019-09-10T23:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to close App using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/430570#M68029</link>
      <description>&lt;P&gt;This is what I needed. Since 'thisModuleInstance' is reserved, it would be helpful to add some documentation when a user creates a new application, eg&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jsdejmp_1-1635280612145.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/37031i6AADCA320621FD36/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jsdejmp_1-1635280612145.png" alt="jsdejmp_1-1635280612145.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 20:37:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/430570#M68029</guid>
      <dc:creator>jsdejmp</dc:creator>
      <dc:date>2021-10-26T20:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to close App using JSL?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/536863#M75871</link>
      <description>&lt;P&gt;Thank you for that information and example.&amp;nbsp; This exactly what I've been searching the forums to do!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 12:38:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-close-App-using-JSL/m-p/536863#M75871</guid>
      <dc:creator>tbidwell</dc:creator>
      <dc:date>2022-08-24T12:38:28Z</dc:date>
    </item>
  </channel>
</rss>

