<?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: Script for combining data table scripts with data from multiple files and saving into on JSL file in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-for-combining-data-table-scripts-with-data-from-multiple/m-p/899017#M105891</link>
    <description>&lt;P&gt;Depending on how you would be using the tables later, you could collect either to JMP Project or to a zip file (both can be done with JSL). You might have to create a separate table loader script if you go this route unless you wish to use the files from JMP Project. I don't personally like their implementation at all so I tend to avoid them, but I have used them from time to time to package JMP files for archiving purposes.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 07 Sep 2025 05:08:13 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-09-07T05:08:13Z</dc:date>
    <item>
      <title>Script for combining data table scripts with data from multiple files and saving into on JSL file</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-combining-data-table-scripts-with-data-from-multiple/m-p/899001#M105889</link>
      <description>&lt;P&gt;Hey everyone!&lt;/P&gt;
&lt;P&gt;Okay after trying for way to long I am stuck on how to get this code to work.&amp;nbsp; I am trying to make a script that will allow a user to select from a list of open files, and for each file selected the code will copy the data table scripts and then paste them all into a single JSL file that I can then run at a later time and will open all the data tables again.&amp;nbsp; Basically like a way to pack a bunch of data tables into a single file (without having to ZIP them) so it is easier to store more complex analysis. This code does most of what I want but I can't get the table scripts to save to a JSL file, they keep wanting to open a copy of the files.&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);


nw = new window("Trial",show menu(0),
	vlistbox(
			hlistbox(
				panelbox("Open data tables",
					lb = listbox(get data table list ());
					),
				panelbox("Data tables to save into one script file",
					lb2 = listbox();
					),
					
			),
			buttonbox("press to select tables",dtla=lb &amp;lt;&amp;lt; Get Selected;lb2 &amp;lt;&amp;lt; Append( dtla );  ),
			buttonbox("press to remove tables",lb2 &amp;lt;&amp;lt; Remove Selected();  ),
			panelbox("what is the file name?",
					teb1=Texteditbox();
					),
			buttonbox("press to save",
				dtlb=lb2 &amp;lt;&amp;lt; Get items;
				fn=teb1 &amp;lt;&amp;lt; Get Text();

				list_of_table_scripts={};

				For( i = 1, i &amp;lt;= N Items( dtlb ), i++,
						y = datatable(dtlb[i]) &amp;lt;&amp;lt; Get Script With Data Table();

						insertinto(list_of_table_scripts,y);
					);
				
				Save Text File( "$desktop\"||fn||".jsl", y );

				nw&amp;lt;&amp;lt; Close Window;
				)
				



			  )
			
	);
	
teb1&amp;lt;&amp;lt; Set Width( 200 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks for any guidance!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Sun, 07 Sep 2025 03:07:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-combining-data-table-scripts-with-data-from-multiple/m-p/899001#M105889</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2025-09-07T03:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script for combining data table scripts with data from multiple files and saving into on JSL file</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-combining-data-table-scripts-with-data-from-multiple/m-p/899015#M105890</link>
      <description>&lt;P&gt;I wouldn't suggest saving data table as a script unless it is very small as the script size can quickly get massive. But if you really want to do this, you could use something like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt1 = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

tables = Get Data Table List() &amp;lt;&amp;lt; get name;

tablescripts = {};

For Each({tablename}, tables,
	s = DataTable(tablename) &amp;lt;&amp;lt; Get Script;
	Insert Into(tablescripts, Char(Name Expr(s)));
);

Save Text File("$DOWNLOADS/demo.jsl", Concat Items(tablescripts, ";"));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 Sep 2025 04:37:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-combining-data-table-scripts-with-data-from-multiple/m-p/899015#M105890</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-09-07T04:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Script for combining data table scripts with data from multiple files and saving into on JSL file</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-combining-data-table-scripts-with-data-from-multiple/m-p/899017#M105891</link>
      <description>&lt;P&gt;Depending on how you would be using the tables later, you could collect either to JMP Project or to a zip file (both can be done with JSL). You might have to create a separate table loader script if you go this route unless you wish to use the files from JMP Project. I don't personally like their implementation at all so I tend to avoid them, but I have used them from time to time to package JMP files for archiving purposes.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Sep 2025 05:08:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-combining-data-table-scripts-with-data-from-multiple/m-p/899017#M105891</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-09-07T05:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Script for combining data table scripts with data from multiple files and saving into on JSL file</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-combining-data-table-scripts-with-data-from-multiple/m-p/899034#M105892</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Added your code to mine and this works great!!&amp;nbsp; Thanks for the heads up on file size, I will have to keep an eye on that.&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);


nw = new window("Trial",show menu(0),
	vlistbox(
			hlistbox(
				panelbox("Open data tables",
					lb = listbox(get data table list ());
					),
				panelbox("Data tables to save into one script file",
					lb2 = listbox();
					),
					
			),
			buttonbox("press to select tables",dtla=lb &amp;lt;&amp;lt; Get Selected;lb2 &amp;lt;&amp;lt; Append( dtla );  ),
			buttonbox("press to remove tables",lb2 &amp;lt;&amp;lt; Remove Selected();  ),
			panelbox("what is the file name?",
					teb1=Texteditbox();
					),
			buttonbox("press to save",
				dtlb=lb2 &amp;lt;&amp;lt; Get items;
				fn=teb1 &amp;lt;&amp;lt; Get Text();

				tablescripts = {};

				For Each({tablename}, dtlb,
					s = DataTable(tablename) &amp;lt;&amp;lt; Get Script;
					Insert Into(tablescripts, Char(Name Expr(s)));
				);
				
				Save Text File( "$desktop\"||fn||".jsl", Concat Items(tablescripts, ";") );

				nw&amp;lt;&amp;lt; Close Window;
				)
				



			  )
			
	);
	
teb1&amp;lt;&amp;lt; Set Width( 200 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 Sep 2025 17:02:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-combining-data-table-scripts-with-data-from-multiple/m-p/899034#M105892</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2025-09-07T17:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Script for combining data table scripts with data from multiple files and saving into on JSL file</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-combining-data-table-scripts-with-data-from-multiple/m-p/899035#M105893</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;, what would be the JSL for saving to a ZIP file?&amp;nbsp; I don't see anything in the scripting index.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Sep 2025 17:12:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-combining-data-table-scripts-with-data-from-multiple/m-p/899035#M105893</guid>
      <dc:creator>shampton82</dc:creator>
      <dc:date>2025-09-07T17:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script for combining data table scripts with data from multiple files and saving into on JSL file</title>
      <link>https://community.jmp.com/t5/Discussions/Script-for-combining-data-table-scripts-with-data-from-multiple/m-p/899036#M105894</link>
      <description>&lt;P&gt;I think you have to save your tables temporarily so you can load them as blobs&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");

dt &amp;lt;&amp;lt; Save("$TEMP\blob.jmp"); // save jmp table to load it as a blob
Close(dt, no save);
b = Load Text File("$TEMP\blob.jmp", blob);

za = Open("$TEMP\deleteMe.zip", zip);
za &amp;lt;&amp;lt; Write("Big Class.jmp", b);

Delete File("$TEMP\blob.jmp");
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are quite a few improvements which could be added here.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Sep 2025 17:30:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-for-combining-data-table-scripts-with-data-from-multiple/m-p/899036#M105894</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-09-07T17:30:15Z</dc:date>
    </item>
  </channel>
</rss>

