Author |
Topic  |
|
elelab
USA
8 Posts |
Posted - 10/03/2005 : 1:35:53 PM
|
Origin Version : 7 SR4 Operating System: Win2K After creating a number of graphs in a project, I often need to add the same text label to all of them. I can activate each one and paste the label, but there can be a lot of them and I'd like a LabTalk macro to set up a loop, cycle through all the existing windows and add the label to all of the windows of type Plot (using the Label command.) The LabTalk manual refers to the "Window menu window list" in a couple of places. Two questions: Can I access this "window list" from LabTalk? Is there a way to test if the window is type plot, data, or wks?
Thanks, Tony |
|
Mike Buess
USA
3037 Posts |
Posted - 10/03/2005 : 2:50:15 PM
|
Hi Tony,
The document command with the -e option will do exactly what you want. The following script loops through all graph windows in the project and applies the same script or command to each. Note that %H names the current window for each iteration and this example merely types the name to the script window.
doc -e P { // command or script goes here, for example... type %H; };
...Although you don't need it in the example above you can use the exist() function to obtain the window type...
exist(%H)=; EXIST(DATA1)=2 // if wks EXIST(GRAPH1)=3 // graph EXIST(MATRIX1)=5 // matrix
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 10/03/2005 3:06:48 PM |
 |
|
elelab
USA
8 Posts |
Posted - 10/04/2005 : 4:43:11 PM
|
Thanks, Mike. That'll do it! I must have spent 2 hours RingTFM and on-line help, but the "Document" command just somehow didn't register as a possibility for what I wanted. (Maybe if it had been called "Project" instead of "Document".)
|
 |
|
|
Topic  |
|
|
|