7
$\begingroup$

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

$\endgroup$
4
  • 1
    $\begingroup$ try FrontEndTokenExecute["OpenHelpLink"]? $\endgroup$
    – kglr
    Commented Sep 26, 2018 at 4:11
  • 1
    $\begingroup$ 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. $\endgroup$
    – b3m2a1
    Commented Sep 26, 2018 at 4:50
  • $\begingroup$ Possible duplicate: mathematica.stackexchange.com/q/41725 Also related: mathematica.stackexchange.com/q/16460 $\endgroup$
    – Michael E2
    Commented Sep 26, 2018 at 17:27
  • $\begingroup$ "OpenHelpLink" works for me. $\endgroup$ Commented Sep 26, 2018 at 19:32

1 Answer 1

8
$\begingroup$

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.

$\endgroup$
0

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.