8

In Mathematica, almost everything is notebook: your "Untitled-1.nb" is a notebook, Help documentation are a series of notebooks, even those windows helping you to draw things or format your notebooks are, themselves, notebooks.

But I occasionally find some exceptions and I want to know what are they.

Run the following code and then open new palettes or notebooks, new names will bump out, but when opening the "Preference" window or "Enter Activation Key" window, nothing will happen.

Dynamic[Notebooks[], UpdateInterval -> 1]

Are they specially formatted and styled notebooks or some wierd things other than notebooks which are constructed using more basic form of programming? How can we know what's the content of them using something like NotebookGet?

Alexey Popkov
  • 61,809
  • 7
  • 149
  • 368
Wjx
  • 9,558
  • 1
  • 34
  • 70

3 Answers3

10

The "Preferences" and "Enter Activation Key" windows are Palette Notebooks located in the directory

FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", "SystemResources"}]

(look at "Preferences.nb" and "ActivationDialog.nb").

But (according to an old MathGroup post by John Fultz) the "Option Inspector" is written in C.

As to why Notebooks[] doesn't list them, I can only guess that the most probable reason is that they aren't opened by the FrontEnd in the usual way. Probably they are loaded as Front End Resources or something similar. In support of this guess I can note that they don't appear in the list of recently opened files in the File menu when you open them as menu items (i.e. via Edit ► Preferences... and Help ► Enter Activation Key... ), but they do appear in this list when you open them directly by double-clicking in the File Explorer. And in the latter case they are listed by Notebooks[]!

Alexey Popkov
  • 61,809
  • 7
  • 149
  • 368
  • But it's wierd that other Palette notebooks can be find in Notebooks[] but this two cannot, why will that happen? – Wjx Aug 09 '16 at 11:57
  • @Wjx I updated the answer. – Alexey Popkov Aug 09 '16 at 12:16
  • Well, but when opening other palettes, they will be shown in Notebooks[] but they won't appear in "recently opened" too. – Wjx Aug 09 '16 at 12:50
  • @Wjx Notice that by "opening other palettes" you mean opening them via the Palettes menu, not via File ► Open..., right? If you use the latter method, they will do appear in the list of recently opened files. So we see that there are already two different documented ways to open a Palette. Since FrontEndResource by the essence is a Palette too, we have also third, undocumented way... – Alexey Popkov Aug 09 '16 at 14:34
9

With addition to Alexey's answer, FrontEnd probably hides them with:

 FrontEndExecute @ FrontEnd`SetNotebookInList[EvaluationNotebook[], False]

You can use it too to toggle appearance on Notebooks[] list.

Kuba
  • 136,707
  • 13
  • 279
  • 740
6

One other note, you can find every single notebook with:

FrontEndExecute@
 FrontEnd`ObjectChildren[$FrontEnd]
b3m2a1
  • 46,870
  • 3
  • 92
  • 239