Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

In notebooks you can press F1 (or Shift+F1 for a new window) to:

  1. open the help page of the marked Symbol or the Symbol under the cursor in the Documentation Center
  2. to search the Documentation Center, if no direct page was available

Question: Is it possible to achieve exactly this behavior with a function searchDoc[input_String]?

Related issues

Related 1: As stated in the documentation to Hyperlink, this here opens the documentation of Plot in a new window

NotebookOpen["paclet:/ref/Plot"]

but if the "paclet" does not exist, an error message appears instead of a search in the docs.

Related 2: It's possible to mimic the behavior of F1 with a FrontEndToken.

Button["HEEELP!!", FrontEndExecute[FrontEndToken["SelectionHelpDialog"]]]

This button shows the help of marked symbols or of symbols under the cursor. Problem here is, that it searches always the selected expression. Maybe there exists something similar which can take an input string.

Related 3: One of the probably biggest resource of information can be found in package

$InstallationDirectory/AddOns/Applications/DocumentationSearch

This seems to contain the functions and helpers which are actually used in the Documentation Center. See for instance what

DocumentationSearch`SearchDocumentation["Graphics"]

gives.

share|improve this question
add comment

1 Answer

up vote 16 down vote accepted

The function you are looking for is Documentation`HelpLookup["some input"]. This is the function that is executed when you hit F1 (after the front end figures out what is under the cursor).

share|improve this answer
    
Awesome!! Exactly what I was looking for. –  halirutan Dec 17 '12 at 18:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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