<?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 can I extract the names of scripts in a folder then execute them? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/how-can-I-extract-the-names-of-scripts-in-a-folder-then-execute/m-p/587306#M79279</link>
    <description>&lt;P&gt;My guess is the For Each loop structure is failing in JMP 14. I think that was added in JMP 15. You can replace that with a traditional For () loop for JMP 14.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Jan 2023 16:24:51 GMT</pubDate>
    <dc:creator>Jed_Campbell</dc:creator>
    <dc:date>2023-01-06T16:24:51Z</dc:date>
    <item>
      <title>how can I extract the names of scripts in a folder then execute them?</title>
      <link>https://community.jmp.com/t5/Discussions/how-can-I-extract-the-names-of-scripts-in-a-folder-then-execute/m-p/586929#M79244</link>
      <description>&lt;P&gt;I am trying to extract the names of files in a subfolder and then extract them,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far I am using the&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Files in directory()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;And getting a list and adding to a data table, but I am struggling to get from here to an executable jsl file that will run them all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance would be great&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 16:44:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-can-I-extract-the-names-of-scripts-in-a-folder-then-execute/m-p/586929#M79244</guid>
      <dc:creator>AlanBell</dc:creator>
      <dc:date>2023-06-08T16:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: how can I extract the names of scripts in a folder then execute them?</title>
      <link>https://community.jmp.com/t5/Discussions/how-can-I-extract-the-names-of-scripts-in-a-folder-then-execute/m-p/586954#M79246</link>
      <description>&lt;P&gt;I don't understand this part: "&lt;EM&gt;And getting a list and adding to a data table"&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Depending where you are executing the scripts from you can use Include() (files) or &amp;lt;&amp;lt; Run Script (table scripts)&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 14:05:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-can-I-extract-the-names-of-scripts-in-a-folder-then-execute/m-p/586954#M79246</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-01-05T14:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: how can I extract the names of scripts in a folder then execute them?</title>
      <link>https://community.jmp.com/t5/Discussions/how-can-I-extract-the-names-of-scripts-in-a-folder-then-execute/m-p/587018#M79254</link>
      <description>&lt;P&gt;When getting files in directory it wasn't including the full path, so I was adding the list to data table and adding the rest of the path and semi colons to get the syntax correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was hoping to include the names as a script with a load of include and file names. And have the file in task scheduler and running every day etc&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 15:30:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-can-I-extract-the-names-of-scripts-in-a-folder-then-execute/m-p/587018#M79254</guid>
      <dc:creator>AlanBell</dc:creator>
      <dc:date>2023-01-05T15:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: how can I extract the names of scripts in a folder then execute them?</title>
      <link>https://community.jmp.com/t5/Discussions/how-can-I-extract-the-names-of-scripts-in-a-folder-then-execute/m-p/587021#M79256</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;lstFiles = Files in Directory ("$SAMPLE_DATA\Loss Function Templates");

for each ({i}, lstFiles,
	//if extension is .jsl, then it's a script, and should be executed
	if (right(i,3)=="jsl", include("$SAMPLE_DATA\Loss Function Templates\"||i));
);

//put values in a new data table
dt = new table ("table",
	new column ("Fname", character, set values (lstFiles))
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This should be what you're looking for. The bit about putting the list in a table doesn't do anything, other than put them in the table, so unless you actually need the filenames in a table, this can be skipped.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 15:44:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-can-I-extract-the-names-of-scripts-in-a-folder-then-execute/m-p/587021#M79256</guid>
      <dc:creator>Jed_Campbell</dc:creator>
      <dc:date>2023-01-05T15:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: how can I extract the names of scripts in a folder then execute them?</title>
      <link>https://community.jmp.com/t5/Discussions/how-can-I-extract-the-names-of-scripts-in-a-folder-then-execute/m-p/587303#M79278</link>
      <description>&lt;P&gt;Thanks for that, worked great. What are the changes that would cause it to fail in JMP 14 but not 16.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 16:17:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-can-I-extract-the-names-of-scripts-in-a-folder-then-execute/m-p/587303#M79278</guid>
      <dc:creator>AlanBell</dc:creator>
      <dc:date>2023-01-06T16:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: how can I extract the names of scripts in a folder then execute them?</title>
      <link>https://community.jmp.com/t5/Discussions/how-can-I-extract-the-names-of-scripts-in-a-folder-then-execute/m-p/587306#M79279</link>
      <description>&lt;P&gt;My guess is the For Each loop structure is failing in JMP 14. I think that was added in JMP 15. You can replace that with a traditional For () loop for JMP 14.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2023 16:24:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/how-can-I-extract-the-names-of-scripts-in-a-folder-then-execute/m-p/587306#M79279</guid>
      <dc:creator>Jed_Campbell</dc:creator>
      <dc:date>2023-01-06T16:24:51Z</dc:date>
    </item>
  </channel>
</rss>

