7
$\begingroup$

How can I programmatically open a palette from the Palettes menu? Is there a Front End token for this?


Motivation:

Certain settings for the palettes that are installed into standard locations and show up in the Palettes menu are stored in the "PalettesMenuSettings" global option (accessible through the Option Inspector or CurrentValue[$FrontEnd, "PalettesMenuSettings"]). These settings become active only if the palette is opened through the Palettes menu. If the palette notebook is opened directly (through the operating system's file manager or File -> Open...), then these settings do not take effect.

Use case:

I need to re-open the image uploader palette after it has updated itself. The upload history is stored in the "PalettesMenuSettings".

$\endgroup$
4
  • $\begingroup$ Did you check this list? stackoverflow.com/a/4209612/353410 $\endgroup$ Commented Jul 21, 2012 at 23:03
  • $\begingroup$ @belisarius Thanks! Where on earth did you find that list? It's extremely useful! Can you post an answer saying that FrontEndToeknExecute["OpenFromPalettesMenu", notebookFileName] will do it? $\endgroup$
    – Szabolcs
    Commented Jul 22, 2012 at 10:01
  • $\begingroup$ The links to the sources are in that very post. Glad to help :) $\endgroup$ Commented Jul 22, 2012 at 13:59
  • $\begingroup$ New and more complete list here mathematica.stackexchange.com/a/8606/193 $\endgroup$ Commented Jul 22, 2012 at 15:03

1 Answer 1

8
$\begingroup$

In this answer I posted a large stock of undocumented FE tokens.

Per your comment under the question, the required token is in that list:

FrontEndTokenExecute["OpenFromPalettesMenu", notebookFileName]
$\endgroup$
2
  • 2
    $\begingroup$ you can probably copy it here so that it's on our site (at least, the ones not already mentioned) $\endgroup$
    – rm -rf
    Commented Jul 22, 2012 at 14:05
  • $\begingroup$ @R.M Done. It was already linked by Chris there, I just made it self contained. $\endgroup$ Commented Jul 22, 2012 at 14:36

Your Answer

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

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