<?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: Method to prevent &amp;quot;Do you want to save&amp;quot; message? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/527896#M75166</link>
    <description>&lt;P&gt;Hi Craige. &amp;nbsp;I assume you mean to add that line to the "On Close" script. &amp;nbsp;I tried that too. &amp;nbsp;The problem is that the save prompt appears prior to the On Close script being executed. &amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jul 2022 21:50:19 GMT</pubDate>
    <dc:creator>nikles</dc:creator>
    <dc:date>2022-07-28T21:50:19Z</dc:date>
    <item>
      <title>Method to prevent "Do you want to save" message?</title>
      <link>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/527885#M75164</link>
      <description>&lt;P&gt;Hi. &amp;nbsp;I'm wondering if there is a way I can prevent the "Do you want to save..." message when a table is closed? &amp;nbsp;That is, this message:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="nikles_0-1659042298514.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/44399iA64C585EE2C220A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="nikles_0-1659042298514.png" alt="nikles_0-1659042298514.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Why? &amp;nbsp;Because I want to allow the user to make changes to the table, but I want to force them to save as a csv because we have other apps that require csv format. &amp;nbsp;To do this, I'm adding an " &amp;lt;&amp;lt; On Close" script:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
a = dt &amp;lt;&amp;lt; is Dirty;
Show(a);
dt &amp;lt;&amp;lt; add rows(5);
b = dt &amp;lt;&amp;lt; is dirty;
Show(b);
dt &amp;lt;&amp;lt; On Close(
	dt = CurrentDataTable();
	If(dt &amp;lt;&amp;lt; Is Dirty,
		dt &amp;lt;&amp;lt; Save As("$DESKTOP/file.csv")
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, the "Do you want to save..." message still always appears prior to saving the csv. &amp;nbsp;I really don't want the user to save as both a jmp table and csv file, because then it creates 2 copies of the same doc, which will lead to confusion. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Specs:&lt;/P&gt;&lt;P&gt;JMP Pro 16.2.0&lt;/P&gt;&lt;P&gt;macOS Big Sur: 11.6.7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:05:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/527885#M75164</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2023-06-09T17:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Method to prevent "Do you want to save" message?</title>
      <link>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/527892#M75165</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt&amp;lt;&amp;lt;setDirty(0);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will mark the table "not dirty", preventing the save prompt.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 21:35:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/527892#M75165</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-07-28T21:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Method to prevent "Do you want to save" message?</title>
      <link>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/527896#M75166</link>
      <description>&lt;P&gt;Hi Craige. &amp;nbsp;I assume you mean to add that line to the "On Close" script. &amp;nbsp;I tried that too. &amp;nbsp;The problem is that the save prompt appears prior to the On Close script being executed. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 21:50:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/527896#M75166</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2022-07-28T21:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Method to prevent "Do you want to save" message?</title>
      <link>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/527911#M75168</link>
      <description>&lt;P&gt;Set the &lt;EM&gt;not dirty&lt;/EM&gt; state right after the table is loaded or modified. I sometimes do that for temporary tables I might want to examine but don't want to keep. The idea is that any time a table is different from the version saved on disk it is not a clean copy of what is on disk and needs to be saved. A new table that has not been saved is dirty, but you can change it.&lt;/P&gt;
&lt;P&gt;edit: since you are testing the dirty flag to decide it it needs saving, you'll need another approach, perhaps always saving it.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 10:53:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/527911#M75168</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-07-29T10:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Method to prevent "Do you want to save" message?</title>
      <link>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/528199#M75193</link>
      <description>&lt;P&gt;Aha - yes, that's the issue. &amp;nbsp;To prevent the save prompt by setting the non-dirty state when the table is loaded: easy. &amp;nbsp;To set the non-dirty state after anytime the user modifies the table: I'm not aware of any way to do this (such as an " &amp;lt;&amp;lt; On Change()" message). &amp;nbsp;Maybe there's just no solution. :(&lt;/img&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 15:17:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/528199#M75193</guid>
      <dc:creator>nikles</dc:creator>
      <dc:date>2022-07-29T15:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Method to prevent "Do you want to save" message?</title>
      <link>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/528213#M75194</link>
      <description>&lt;P&gt;Depending on what you are trying to do and what modifications you allow users to do, maybe you could use &lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/data-tables-2.shtml?os=win&amp;amp;source=application#ww2077532" target="_blank" rel="noopener"&gt;New Data Box()&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 15:30:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/528213#M75194</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-07-29T15:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Method to prevent "Do you want to save" message?</title>
      <link>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/528268#M75201</link>
      <description>The dirty flag is set each time a change is made. But if it is set when the table is closed, then you will get a save prompt. You could try an experiment where you save it as a CSV file early on, I'm not sure where it will save it later after another change is made. I think it might still remember that it's saving to the CSV file.</description>
      <pubDate>Fri, 29 Jul 2022 19:06:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Method-to-prevent-quot-Do-you-want-to-save-quot-message/m-p/528268#M75201</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2022-07-29T19:06:48Z</dc:date>
    </item>
  </channel>
</rss>

