I am constantly generating sets of graphs just to look at, and then I spend too long closing each graph individually without saving. Is there an easy way to close all open graphs at once (without saving)?
Note that if you hold down the Alt key when you click the close button on a graph, Igor won't ask you whether or not you want to save the recreation macro--it will just kill the graph. This also works for other window types such as tables, panels, and layouts.
string fulllist = WinList("*", ";","WIN:1")
string name, cmd
variable i
for(i=0; i<itemsinlist(fulllist); i +=1)
name= stringfromlist(i, fulllist)
sprintf cmd, "Dowindow/K %s", name
execute cmd
endfor
end
You can also make a macro so that you can call it from the menu.
KillAllGraphs()
end
October 21, 2011 at 08:54 am - Permalink
October 21, 2011 at 08:55 am - Permalink
October 21, 2011 at 10:42 am - Permalink
Rather than this:
sprintf cmd, "Dowindow/K %s", name
execute cmd
you can do this:
Dowindow/K $name
This illustrates the general principle that $ converts a string expression to an object name.
For details:
October 21, 2011 at 06:34 pm - Permalink