<?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: Scripts for multiple data windows in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/85448#M38213</link>
    <description>&lt;P&gt;This is an excellent starting point. Thank you! So to use on a new csv (the data type of the files actually), I open the script in the editor, change the file name, and&amp;nbsp;run the script from the editor?&amp;nbsp; It is also unclear to me how to set the import settings for the data file using the script. Like setting the delimiter (semicolons in this case) or the line for column labels and row the data begins.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Tue, 11 Dec 2018 15:59:17 GMT</pubDate>
    <dc:creator>wbwing</dc:creator>
    <dc:date>2018-12-11T15:59:17Z</dc:date>
    <item>
      <title>Scripts for multiple data windows</title>
      <link>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/84837#M37976</link>
      <description>&lt;P&gt;I am just getting started in JMP. I have a very basic current need. I need a quicker way to do a calculation and visualization of motor data files I'm recording. I am tired of doing it manually in excel everytime. A friend suggested JMP as a way to do it consisitently and quickly without having to get into Excel Macros. I downloaded the trial and am spending a couple days to see if it can do the job before convincing my boss to purchase. I'm very happy how quickly I was able to add calculated columns and graph the data. However I would really like to be able to load a data file (or series of files) and click a button that will add the columns and make the simple plot. I know the answer lies with scripts. From the graph builder I saved the script, but that script only shows up in the data window I already completed the task with. Everytime I open a new file, that script is no longer available. Furthermore, I'm pretty sure that script only makes the plot. How do I save a script to add the two columns I need when I open a new file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 02:27:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/84837#M37976</guid>
      <dc:creator>wbwing</dc:creator>
      <dc:date>2018-12-03T02:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts for multiple data windows</title>
      <link>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/84841#M37980</link>
      <description>&lt;P&gt;If you added files, they are not appearing.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 05:42:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/84841#M37980</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-12-03T05:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts for multiple data windows</title>
      <link>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/84843#M37982</link>
      <description>&lt;P&gt;Sounds like you might want to put everything into one script. If so, the example below should get you started (though it uses a CSV file).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do 'File &amp;gt; New &amp;gt; New Script' to open a window, copy the code below, and paste it in. You can run it as it is (with 'Edit &amp;gt; Run Script'), and then adapt it to your case. Do 'File &amp;gt; Save' to save your new script file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To learn a little about JSL, try 'Help &amp;gt; Books &amp;gt; Scripting Guide'.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// Read in a sample csv file
dt = Open( "$SAMPLE_IMPORT_DATA/Book1.csv" );

// Add a formula column
dt &amp;lt;&amp;lt; 
// To get this code, build your formula 'by hand', then do 'File &amp;gt; New &amp;gt; New Script',
// type the command 'columnRef &amp;lt;&amp;lt; getScript', and then 'Edit &amp;gt; Run Script'. Then look
// immediately below or in 'Window &amp;gt; Log' to get the result. In this case, the command
// was: ':Formula &amp;lt;&amp;lt; getScript'.
New Column( "Formula", Numeric, "Continuous", Formula( (:Name( "1" ) + :Name( "2" )) / :Name( "3" ) ) );

// Now use Graph Builder 'by hand', and get the JSL code it makes for you . . .
dt &amp;lt;&amp;lt;
// . . . and paste it here
Graph Builder(
	Size( 531, 452 ),
	Show Control Panel( 0 ),
	Variables( X( :Name( "1" ) ), Y( :Formula ) ),
	Elements( Points( X, Y, Legend( 6 ) ), Smoother( X, Y, Legend( 7 ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 09:17:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/84843#M37982</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2018-12-03T09:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts for multiple data windows</title>
      <link>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/84858#M37987</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/13435"&gt;@wbwing&lt;/a&gt;&amp;nbsp;every scripting language requires a learning curve.&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3605"&gt;@ian_jmp&lt;/a&gt;&amp;nbsp;provided the basics: &lt;STRONG&gt;Open(),&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;New Column() and GraphBuilder() &lt;/STRONG&gt;for your scripting tasks. But you will need more.&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;My experience is that JSL, the JMP Scripting Language, has a less steep learning curve compared to other languages due to its extensive &lt;STRONG&gt;Scripting Index&lt;/STRONG&gt; found in the main menu, its forgiving syntax, and &lt;STRONG&gt;Save Script&lt;/STRONG&gt;&amp;nbsp;options for its rich set of&amp;nbsp; graph and analysis platforms. However, JMP does not&amp;nbsp; provide a macro recorder, therefore it requires the scripter to learn the syntax (valid instructions) for point and click commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached a simple script and 4 Excel files to play with. The script was created using JMP 14.&amp;nbsp; The screenshot below shows the interactive display window. It&amp;nbsp; has&amp;nbsp; two action buttons, &lt;STRONG&gt;Select File&lt;/STRONG&gt; and &lt;STRONG&gt;Journal&lt;/STRONG&gt;. The script starts the file search in your downloads directory. Good luck with your quest to have JMP available.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Script Display Window" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/14678i63AC94592B35448D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="Script Display Window" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Script Display Window&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 12:32:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/84858#M37987</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-12-03T12:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts for multiple data windows</title>
      <link>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/84859#M37988</link>
      <description>&lt;P&gt;The script did not get attached, see below.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2018 12:34:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/84859#M37988</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-12-03T12:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts for multiple data windows</title>
      <link>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/85448#M38213</link>
      <description>&lt;P&gt;This is an excellent starting point. Thank you! So to use on a new csv (the data type of the files actually), I open the script in the editor, change the file name, and&amp;nbsp;run the script from the editor?&amp;nbsp; It is also unclear to me how to set the import settings for the data file using the script. Like setting the delimiter (semicolons in this case) or the line for column labels and row the data begins.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 15:59:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/85448#M38213</guid>
      <dc:creator>wbwing</dc:creator>
      <dc:date>2018-12-11T15:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts for multiple data windows</title>
      <link>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/85450#M38215</link>
      <description>&lt;P&gt;This is also a very useful script. Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 16:00:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/85450#M38215</guid>
      <dc:creator>wbwing</dc:creator>
      <dc:date>2018-12-11T16:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts for multiple data windows</title>
      <link>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/85467#M38220</link>
      <description>&lt;P&gt;If you have a bunch of .csv files of the same 'type' (meaning different contents, but laid out in the same way), use 'File &amp;gt; Open', navigate to one of them, then step though the import wizard 'by hand' making whatever choices you need to to read the contents correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If all goes well you will get a JMP table. This table will have a 'Source' script, which is the JSL that tells JMP how to read the source file. If you right click on the little green 'run' arrow of this script, you can select 'Edit' to inspect the code. You can then cut and paste this into the code given above. To use it with a different file of the same type, just change the location of the file as defined in the 'Open()' command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to let a user pick thr file to process, look in 'Help &amp;gt; Scripting Index' for 'Pick File()'.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 17:20:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/85467#M38220</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2018-12-11T17:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts for multiple data windows</title>
      <link>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/85468#M38221</link>
      <description>&lt;P&gt;The attached script is a modification of the previous script:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;gets the user import settings&lt;/LI&gt;&lt;LI&gt;set the import settings with semicolon field delimiters, etc&lt;/LI&gt;&lt;LI&gt;Pick File looks for CSV or text files. If you do not want txt remove &lt;STRONG&gt;;txt&lt;/STRONG&gt; from line 107&lt;/LI&gt;&lt;LI&gt;Uses Open(newfid, Invisible) since open will use the import settings preferences&lt;/LI&gt;&lt;LI&gt;changes on close to reset the users import settings&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 11 Dec 2018 17:49:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/85468#M38221</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-12-11T17:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Scripts for multiple data windows</title>
      <link>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/85469#M38222</link>
      <description>&lt;P&gt;BTW, the method&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3605"&gt;@ian_jmp&lt;/a&gt;&amp;nbsp;described is exactly what I do to get the import settings.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2018 17:52:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scripts-for-multiple-data-windows/m-p/85469#M38222</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-12-11T17:52:26Z</dc:date>
    </item>
  </channel>
</rss>

