is there a way to execute a Labtalk script on the windows that the user marks in the Project Explorer (using the mouse, one window or several by using Shift)? My idea is to get the window names of some graphs (target %a), rename them in order to plot them in a Layout-Template window that was inserted before and then rename back to restore the old window names. Doing this manually with %a and %b it would look like this:
There is no way to manually select multiple windows like you suggest. You can create a multiple window selection dialog in LabTalk as described in the "Creating multiple selection dialogs" topic at http://labtalk.nmrtools.com.
Another method available in Origin 7.0 or later (and possibly 6.1) is to create a project folder and move the graphs you want on the layout to that folder. Then select View->View Windows->Active Folder, select the new folder in Project Explorer and run a script based on this...
nn=0; win -t Layout Layout_8graphs.otp Layout_01; doc -ef P { // loop through all plot windows in folder %A=%H; // plot window name nn++; %B=Graph$(nn); // placeholder name win -r %A %B; win -r %B %A; doc -uw; };
I'm not convinced the layout will turn out like you expect but it might be worth trying.
that works really great, the script on the homepage is kind of neat. And it also does the thing with the template that I wanted so thank you very much indeed.