# How can programmatically close the palette automatically opened by the Notation package [duplicate]

This question already has an answer here:

I use << Notation in my init.m to load some custom notations, but now every time I start the kernel the palette always shows up, is any way to stop that?

I tried using NotebookClose[nb] but I don't know how to get a handle on that palette to use for the argument.

## marked as duplicate by Mr.Wizard♦Feb 14 '15 at 23:31

From the Notation.m package:

AutoLoadNotationPalette is a boolean variable. If False then the Notation palette will not be loaded when the Notation package is loaded. If the value is undefined or True the Notation palette will be loaded when the Notation package loads. Other package designers can set this variable outside of the Notation package through a statement similar to NotationAutoLoadNotationPalette = False.

So, to prevent the palette from loading you can simply use:

NotationAutoLoadNotationPalette = False;
<< "Notation"


To close an already open Notation Palette you can use

NotebookClose[Notebooks["Notation Palette"][[1]]]

• no +1 because you didn't bother to look for an easy to find duplicate -- boo hiss -- Mr.Grouch – Mr.Wizard Feb 14 '15 at 23:32
• Mr.Wizard, fair enough:) – kglr Feb 14 '15 at 23:42

The following worked for me.

 Needs["Notation"]

findNotationPalette[nb_] :=
If[Options[nb, WindowTitle] == {WindowTitle -> "Notation Palette"}, nb, Null]

closeNotationPalette[] :=
Module[{notationNB},
notationNB = Cases[findNotationPalette /@ Notebooks[], _NotebookObject];
If[Length @ notationNB == 1, NotebookClose[notationNB[[1]]], Return[\$Failed]]]

closeNotationPalette[]