Author |
Topic  |
|
sebbey
Germany
70 Posts |
Posted - 05/16/2012 : 08:40:39 AM
|
OriginPro 8.6.0G Operating System: Windows 7 Professional
Hi everyone,
my LabTalk scripts run with a customized toolbar button. The first thing that happens after clicking on the button is this:
impAsc -d;
The ImportASC window pops up and I can select a file to import. If I choose more than one file to Import, all the files are imported into one workbook. Is there a way to import several files into several workbooks, without having to open several ImportASC windows. It would be perfect if I could click the button once, select all the files I need and import all these files in seperate workbooks.
And I have another question. Is it possible to somehow save the settings I need. Maybe within a LabTalk script. The script I'm currently working on will be used by many people who shouldn't be able to change any of these settings, in order for the script to work properly.
Thank you for your help, sebbey |
|
greg
USA
1379 Posts |
Posted - 05/16/2012 : 4:10:28 PM
|
Here is a basic script to import user-selected files into new workbooks:
// Prompt for files dlgfile group:=ASCII multi:=1 init:=%Y; // %Y is your UFF // Loop over all the files loop(ii,1,fname.GetNumTokens(CRLF)) { // Get the next file file$ = fname.GetToken(ii,CRLF)$; impasc file$; // If we are not done, add a new book if(ii < fname.GetNumTokens(CRLF)) newbook; }
There are many places script can be stored and run in Origin, but the two most common would be in a menu or a toolbar. For example, you can use the Custom Menu Organizer found under the Tools menu to add new menus with custom script. |
 |
|
sebbey
Germany
70 Posts |
Posted - 05/21/2012 : 02:38:33 AM
|
hi greg,
thanks for your answer. the script works perfectly and does exactly what i wanted!!
sebbey |
 |
|
|
Topic  |
|
|
|