Using Notebooks
in combination with Cases
or Select
as Istvan has suggested lets you choose all invisible notebooks. As others have mentioned in comments that will (often) include the messages notebook and of course also any other invisible notebooks.
For notebooks that already do exist you can get rid of the messages notebooks which is accessable by Notebooks["Messages"]
but for the rest you would have to search for specific options and content to decide which of those are actually those you search for.
If you do have control about how those notebooks are created, it probably is a good idea to "tag" those notebooks that you potentially need to access later. You could use the WindowTitle
option for this, but there is also the special option TaggingRules
which can be used to attach arbitrary information in form of rules to a notebook. To access these you can use Options
, but the function CurrentValue
is more comfortable for that. Here is what I would do:
Create invisible notebook with a special mark, the string "Temporary"
is arbitrarily chosen, you could use whatever you want for it:
CreateDocument[{}, Visible -> False, TaggingRules -> {"Temporary" -> True}]
then select exactly those notebooks which are tagged as "Temporary"
:
Select[Notebooks[], TrueQ[CurrentValue[#, {TaggingRules, "Temporary"}]] &]
of course you can combine that with checking the Visible
option, but probably that isn't even necessary then...
Nand @@ CurrentValue[Notebooks[], Visible]
but that would include theMessages
notebook. I think you probably need to specify further what you expect $\endgroup$Complement[Notebooks[], Notebooks["Messages"]]
would help. $\endgroup$Notebooks
accepts a string as argument, is it correct that this is equivalent to selecting byWindowTitle
? Do you know why that isn't documented? $\endgroup$WindowTitle
is a good guess, but I can't say definitively whether that's correct. $\endgroup$