[proFit-list] opening a data window using Applecscript

Jeremy Harbinson jeremy_harbinson at me.com
Wed Nov 23 10:36:39 CST 2011


Hi,
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. 

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. 

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):

tell application "pro Fit 6.2.2"
	activate
	make new table  data window
	(*make new table*)
	data import options mode custom headerLines 0 title delimiter "," title length 0 delimiter "f," line length 0 terminator "\\R" date format "yyyy-MM-dd hh:mm:ss" with titles without copyInfo, useDoublequotes and dates
	open "/Users/jeremyharbinson1/IBM/Python files/temp_files/python_2_row_b.csv" with «class impo» given «class as  »:data window
	plot data xAxisColumn 1 yAxisColumn {2} zAxisColumn {} xScaling lin yScaling lin xAxis 1 yAxis 1 point opacity 1.0 curve opacity 1.0 fill opacity 1.0 with autoX, autoY, new window, new graph and connected without selected only and error bars
end tell  

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.......

I would be grateful for any suggestions!
all the best,
Jeremy  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://quantum-soft.com/pipermail/profit-list_quantum-soft.com/attachments/20111123/6c3de687/attachment.html>


More information about the proFit-list mailing list