8
$\begingroup$

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?

$\endgroup$

3 Answers 3

10
$\begingroup$

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[]!

$\endgroup$
4
  • $\begingroup$ But it's wierd that other Palette notebooks can be find in Notebooks[] but this two cannot, why will that happen? $\endgroup$
    – Wjx
    Aug 9, 2016 at 11:57
  • $\begingroup$ @Wjx I updated the answer. $\endgroup$ Aug 9, 2016 at 12:16
  • $\begingroup$ Well, but when opening other palettes, they will be shown in Notebooks[] but they won't appear in "recently opened" too. $\endgroup$
    – Wjx
    Aug 9, 2016 at 12:50
  • $\begingroup$ @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... $\endgroup$ Aug 9, 2016 at 14:34
9
$\begingroup$

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.

$\endgroup$
6
$\begingroup$

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

FrontEndExecute@
 FrontEnd`ObjectChildren[$FrontEnd]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.