7

FrontEndTokenExecute["Save"] saves the current notebook, but FrontEndTokenExecute["Wolfram Documentation"] does not open the documentation notebook. Why?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
George Wolfe
  • 5,462
  • 21
  • 43
  • 1
    try FrontEndTokenExecute["OpenHelpLink"]? – kglr Sep 26 '18 at 04:11
  • 1
    To explain @kglr's comment, these FrontEndToken objects actually reference a special set of token functions the FE provides. You can see them in FrontEndExecute@ FrontEnd`FindFileOnPath["KeyEventTranslations.tr", "PrivatePathsTextResources"] and FrontEndExecute@ FrontEnd`FindFileOnPath["MenuSetup.tr", "PrivatePathsTextResources"]. They do not always have the name provided in the menu. – b3m2a1 Sep 26 '18 at 04:50
  • Possible duplicate: https://mathematica.stackexchange.com/q/41725 Also related: https://mathematica.stackexchange.com/q/16460 – Michael E2 Sep 26 '18 at 17:27
  • "OpenHelpLink" works for me. – George Wolfe Sep 26 '18 at 19:32

1 Answers1

8

Working from kglr's and b3m2a1's comments, I will record a CW answer.

The menu tokens are stored in the file MenuSetup.tr buried deep within the Mathematica installation. To look at it you can execute the following:

SystemOpen[
  FrontEndExecute @
    FrontEnd`FindFileOnPath["MenuSetup.tr", "PrivatePathsTextResources"]]

The result will be the desired file appearing in new front-end window. You can then search in it for "Help". which will give you

menu_token

and thus revealing the token you are looking for.

The above worked for me. I'm running V11.3 on OS X 10.13.4. Alexey Popkov says it didn't work for him. He recommends

FilePrint[
  FrontEndExecute @
    FrontEnd`FindFileOnPath["MenuSetup.tr", "PrivatePathsTextResources"]]

In this case, the result will be the desired file printed in the current Notebook.

Once again, as in fantasy fiction, knowing something's true name gives power over it.

m_goldberg
  • 107,779
  • 16
  • 103
  • 257