<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div>I am trying to write an Applescript that will create a new data window, load a two column csv file into that window, and then plot these two columns. </div><div><br></div><div>Using the record tool of the Applescript editor I was able to get a sequence of commands that do this, except that when run it creates a new data window (I will call this window 2) but then imports the data into the last used  data window and plots the first two columns of this older window (not good). If I rerun the script, it creates a new data window (window 3) and then imports the data into window 2 (created the first time the script was run) and plots that data - data window 3 remaining empty unless I run the script again. </div><div><br></div><div>What I would like is to be able to create a data window, load data into that newly created widow (and not into another one), and plot data from it (and not from the other window). The script I have been using is (in its current form):</div><div><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 39.2px; text-indent: -39.3px; font: normal normal normal 12px/normal Verdana; "><b>tell</b> <span style="color: #1700ff"><i>application</i></span> "pro Fit 6.2.2"</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 78.5px; text-indent: -78.6px; font: normal normal normal 12px/normal Verdana; color: rgb(23, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span></span><b>activate</b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 78.5px; text-indent: -78.6px; font: normal normal normal 12px/normal Verdana; color: rgb(23, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">  </span></span><b>make</b><span style="color: #000000"> </span>new<span style="color: #000000"> </span><i>table</i><span style="color: #000000">  </span><span style="color: #641994">data window</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 78.5px; text-indent: -78.6px; font: normal normal normal 12px/normal Verdana; color: rgb(94, 97, 97); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">       </span></span>(*make new table*)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 78.5px; text-indent: -78.6px; font: normal normal normal 12px/normal Verdana; color: rgb(23, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">   </span></span><b>data import options</b><span style="color: #000000"> </span>mode<span style="color: #000000"> </span><span style="color: #641994">custom</span><span style="color: #000000"> </span>headerLines<span style="color: #000000"> 0 </span>title delimiter<span style="color: #000000"> "," </span>title length<span style="color: #000000"> 0 </span>delimiter<span style="color: #000000"> "f," </span>line length<span style="color: #000000"> 0 </span>terminator<span style="color: #000000"> "<a href="smb://R">\\R</a>" </span>date format<span style="color: #000000"> "yyyy-MM-dd hh:mm:ss" <b>with</b> </span>titles<span style="color: #000000"> <b>without</b> </span>copyInfo<span style="color: #000000">, </span>useDoublequotes<span style="color: #000000"> <b>and</b> </span>dates</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 78.5px; text-indent: -78.6px; font: normal normal normal 12px/normal Verdana; "><span class="Apple-tab-span" style="white-space:pre">      </span><span style="color: #1700ff"><b>open</b></span> "/Users/jeremyharbinson1/IBM/Python files/temp_files/python_2_row_b.csv" <b>with</b> «<span style="color: #1700ff"><i>class</i></span> impo» <b>given</b> «<span style="color: #1700ff"><i>class</i></span> as  »:<span style="color: #641994">data window</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 78.5px; text-indent: -78.6px; font: normal normal normal 12px/normal Verdana; color: rgb(23, 0, 255); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">      </span></span><b>plot data</b><span style="color: #000000"> </span>xAxisColumn<span style="color: #000000"> 1 </span>yAxisColumn<span style="color: #000000"> {2} </span>zAxisColumn<span style="color: #000000"> {} </span>xScaling<span style="color: #000000"> </span><span style="color: #641994">lin</span><span style="color: #000000"> </span>yScaling<span style="color: #000000"> </span><span style="color: #641994">lin</span><span style="color: #000000"> </span>xAxis<span style="color: #000000"> 1 </span>yAxis<span style="color: #000000"> 1 </span>point opacity<span style="color: #000000"> 1.0 </span>curve opacity<span style="color: #000000"> 1.0 </span>fill opacity<span style="color: #000000"> 1.0 <b>with</b> </span>autoX<span style="color: #000000">, </span>autoY<span style="color: #000000">, </span>new window<span style="color: #000000">, </span>new graph<span style="color: #000000"> <b>and</b> </span>connected<span style="color: #000000"> <b>without</b> </span>selected only<span style="color: #000000"> <b>and</b> </span>error bars</div><div><span class="Apple-style-span" style="font-family: Verdana; font-size: 12px; "><b>end</b></span><span class="Apple-style-span" style="font-family: Verdana; font-size: 12px; "> </span><span class="Apple-style-span" style="font-family: Verdana; font-size: 12px; "><b>tell</b></span>  </div><div><br></div><div>This script is not the same as the recorded version - I have been trying (I get the feeling more or less randomly) various combinations of 'make', 'new', 'data', 'table', 'window' etc in place of what is currently 'make new table data window' to create a window that will be the target window for the import and plot commands- nothing worked, resulting in either the same problem described above or an error message. I do not like Applescript.......</div><div><br></div><div>I would be grateful for any suggestions!</div><div>all the best,</div><div>Jeremy  </div></body></html>