For some reason, the System.FileExt.AddType() method doesn't work. But the above does, so I'm not worried about that. At any rate, I need to know how to save the new group so it's there the next time I start Origin. Apparently this information is stored in origin.ini, NOT option.cnf, so system.savePref() doesn't work either. Right now I have to open the options dialog box & change something so it asks me if I want to save the changes (including my file extension group addition via LabTalk). I'd like a LabTalk-way of doing this. Thanks.
File extension information is saved in Origin.ini (FileExt section) and can be edited with the ini object. This would be done totally apart from the system.FileExt methods and the changes you make in Origin.ini will not take effect until the next time you start Origin. Here is the general approach...
1. Define your file extension group as you've already done.
2. Make the same changes to Origin.ini...
ini.file$=%YOrigin.ini; numGroups=ini.FileExt.numGroups; numGroups++; ini.FileExt.numGroups=numGroups; $(numGroups)_Name=Colormaps; $(numGroups)_numTypes=1; $(numGroups)_Type1$="[Colormap files (*.dat)] *.dat"; $(numGroups)_DefType=1; $(numGroups)_OpenPathMode=1; // Open path setting from File Location options $(numGroups)_SavePathMode=0; // Save path setting from File location options
The Open path (DefPath) and Save path (SavePath) values should take care of themselves. They are actually created (along with their respective Modes) by system.fileext.AddGroup().
...Unless you intend to create several File Extension groups then your method of finalizing the changes with the options dialog should be good enough.
quote: File extension information is saved in Origin.ini (FileExt section) and can be edited with the ini object. This would be done totally apart from the system.FileExt methods and the changes you make in Origin.ini will not take effect until the next time you start Origin. Here is the general approach...
1. Define your file extension group as you've already done.
Yes, but I need the script to make my other scripts more portable (no instructions necessary other than just deposit the scripts & run the "install" script). Thanks.