<?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 Problem closing image obj in JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Problem-closing-image-obj-in-JSL/m-p/209542#M42019</link>
    <description>&lt;P&gt;Hello,&amp;nbsp; Hoping to get some help with a JSL script.&amp;nbsp; I am having issues with a newImage object staying open but is completely hidden.&amp;nbsp; Only way I know it is open is because windows fails to delete the file because it says it is open in another program which is fixed by closing JMP.&amp;nbsp; Here is a snippet of my code, I have tried a few obj &amp;lt;&amp;lt; close() and obj &amp;lt;&amp;lt; close window() but the object remains.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;img_t = newImage(path_to_results||"/"||subfolder_list[k]||"/"||image) 
w2 = new window("Image", Show Toolbars(0), Show Menu(0), img_t); 
w2 &amp;lt;&amp;lt; Add Simple ShapeAnnotation(Oval(PX-25,PY-25,PX+25,PY+25 ),color("Yellow"),raised(1)); 
img= w2 &amp;lt;&amp;lt; getpicture(); 
img_t &amp;lt;&amp;lt; Close Window; 
w2 &amp;lt;&amp;lt; Close Window; 
img&amp;lt;&amp;lt;set size({800, 800});&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 May 2019 22:25:07 GMT</pubDate>
    <dc:creator>jjswan33</dc:creator>
    <dc:date>2019-05-20T22:25:07Z</dc:date>
    <item>
      <title>Problem closing image obj in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Problem-closing-image-obj-in-JSL/m-p/209542#M42019</link>
      <description>&lt;P&gt;Hello,&amp;nbsp; Hoping to get some help with a JSL script.&amp;nbsp; I am having issues with a newImage object staying open but is completely hidden.&amp;nbsp; Only way I know it is open is because windows fails to delete the file because it says it is open in another program which is fixed by closing JMP.&amp;nbsp; Here is a snippet of my code, I have tried a few obj &amp;lt;&amp;lt; close() and obj &amp;lt;&amp;lt; close window() but the object remains.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;img_t = newImage(path_to_results||"/"||subfolder_list[k]||"/"||image) 
w2 = new window("Image", Show Toolbars(0), Show Menu(0), img_t); 
w2 &amp;lt;&amp;lt; Add Simple ShapeAnnotation(Oval(PX-25,PY-25,PX+25,PY+25 ),color("Yellow"),raised(1)); 
img= w2 &amp;lt;&amp;lt; getpicture(); 
img_t &amp;lt;&amp;lt; Close Window; 
w2 &amp;lt;&amp;lt; Close Window; 
img&amp;lt;&amp;lt;set size({800, 800});&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 22:25:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Problem-closing-image-obj-in-JSL/m-p/209542#M42019</guid>
      <dc:creator>jjswan33</dc:creator>
      <dc:date>2019-05-20T22:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem closing image obj in JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Problem-closing-image-obj-in-JSL/m-p/209586#M42022</link>
      <description>&lt;P&gt;If you start with a new session in JMP, try this script:&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);
img_t = New Image( "$SAMPLE_IMAGES/tile.jpg" );
w2 = new window("Image", Show Toolbars(0), Show Menu(0), img_t); 
{PX,PY} = w2 &amp;lt;&amp;lt; get size;
w2 &amp;lt;&amp;lt; Add Simple ShapeAnnotation(Oval(PX-25,PY-25,25,25 ),color("Yellow"),raised(1)); 
img= w2 &amp;lt;&amp;lt; get picture(); 
w2 &amp;lt;&amp;lt; Close Window;
//the image objects still exist 
//show(img);
//show(img_t);
img = empty();
img_t = empty();
show(img, img_t); //see LOG: img = Empty(); img_t = Empty();
 
delete symbols({img, img_t});
show symbols();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then look at the LOG window. You will see this: three show results.&amp;nbsp; Symbols/objects can be local, Here, and global. Note I have one global that you likely wll not have.&amp;nbsp; So the key is to replace a variable with a new value and delete the name (symbol).&amp;nbsp; You might want to learn more about &lt;STRONG&gt;Namespaces&lt;/STRONG&gt;&amp;nbsp;in the JMP Scripting Guide.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;img = Empty();
img_t = Empty();
// Here

img = Empty();
img_t = Empty();
PX = 451;
PY = 451;
w2 = DisplayBox[];

// 5 Here

// Global

com.jmp.wmurph.crashrpt.flag = 0;

// 1 Global
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 00:51:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Problem-closing-image-obj-in-JSL/m-p/209586#M42022</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2019-05-21T00:51:35Z</dc:date>
    </item>
  </channel>
</rss>

