Re: Names[] for definitions in the current window/notebook?

*To*: mathgroup at smc.vnet.net*Subject*: [mg28874] Re: Names[] for definitions in the current window/notebook?*From*: Albert Retey <albert.retey at visualanalysis.com>*Date*: Thu, 17 May 2001 04:22:46 -0400 (EDT)*Organization*: Visual Analysis AG*References*: <9dnrmc$svp@smc.vnet.net> <XfiM6.12442$UE4.70076@ralph.vnet.net> <9dtbg4$fb6@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Hi, > In the code above, the anonymous function will get mapped over any > symbol in the system that happens to start with "Figure" (right?). I'm > only interested in definitions that appear explicity in the current > window. > > This isn't a show-stopper, just a minor annoyance Usually many notebooks ("windows") can be (and are) connected to the same kernel. The Names[]-command is a kernel function and the kernel definitions don't know anything about the notebooks (is that correct?), in which they have been defined. So to get what you want needs to be done in either of the following two ways: 1) connect each notebook you have open to an extra kernel via the kernel menue. this of course can change the usual behaviour of your mathematica setup quite a bit: definitions done in one notebook will no longer be available in any of the others. Also the usual license will only allow I think two kernels, if you have acces to a network license you might probablly get problems with other mathematica users if you occupy a dozen licenses or so... 2) instead of the Names["Figure*"] you will need to do some Frontend-Programming to select all the "Graphics"-Cells in the current (the Selected, Evaluation or Button-notebook, whatever way you want to program this) and then Export these Cells. How to perform each of these steps you can read in "the book" (Look for SelectionMove[], NotebookFind[] and related Functions). You could also scan all the "Input"-Cells (or the whole Notebook-Object) for variable-names that begin with Figure and use that list in your existing command. The second approach seems to be much more reasonable, but probably you'll need to learn quite a bit about programming the Mathematica-Frontend. Hope that helps Albert