Launch Origin and plot data by double-clicking on a *.DAT fileI'm happy that my earlier solution worked for you...here is an updated version
which also plots the imported data!
It is possible to launch Origin by double-clicking on a *.DAT file
(an ASCII data file), have Origin automatically import the .DAT file
and then plot all the columns into a graph window. In order to do
this you will need to complete the following three steps:
1. In your Windows Explorer select View
ptions, Click on the File
Types tab, select the file extension DAT, click the Edit button, select
open in the Actions list box, click the Edit button, enter
C:\Origin50\OpenDat.bat in the Application used to perform action
edit box, click OK and Close until you return to the Windows
Explorer.
2. Create the file OpenDat.bat in your C:\Origin50 folder and type in
the following DOS batch commands:
@echo off
echo opendat=1; %%A=%1 > C:\Origin50\OpenDat.cnf
start C:\Origin50\Origin50.exe -a OpenDat.cnf -tw OpenDat.otw
exit
3. Open Origin, click on the New Worksheet button, and set your
ASCII import Options as desired (select File:Import:ASCII Options).
Click on the Text Tool on the Tools toolbar and then click once in the
white area of the new worksheet. Enter OpenDat where it says enter
text here in the Text Control dialog box and click OK. Right click on
the new text object and select Label Control. In the Label Control
dialog box enter OpenDat in the Object Name edit box, select Window
Create from the Script, Run After list box, uncheck the Visible check
box, and enter the following script in the large edit box:
If (opendat==1) { // execute script once
open -w %A; // import ASCII file
queue { // delay execution untill window is
ready
worksheet -s 0 0 0 0; // select all columns
worksheet -p 200 line; // plot selected columns
legend; // add/update legend
};
opendat=0; // don't execute script again
Finally, click OK to close the Label Control dialog box and save the
worksheet as the worksheet template OpenDat.otw in your main
Origin folder (select File:Save Template As).
After completing the above steps, when you double-click on a *.DAT
file Windows will launch OpenDat.bat which will launch Origin which will
import the DAT file that was double-clicked on and then plot all of the
columns
in the worksheet into a graph window.