Creating a Hidden Shortcut control

In the next exercise you create a new topic that automatically launches the LOG file created from the previous exercise.

  1. Create a new topic called User Notes (user_notes.htm).

    This topic is not used to record notes directly; this topic launches the Notepad LOG file created in the previous steps. It's a good idea to store the file in the top-most folder level of the project.

  2. Delete all the text from the screen.

  3. Choose Insert: HTML Help: Shortcut.

  4. Select Hidden (for scripts)

  5. Click Next.

  6. In Program to run when shortcut is activated type: Notes.txt or the name of the Notepad LOG file created in the previous exercise.

  7. In Window class of program window, type: notepad.

    Window class names prevent the same file from opening twice.  For more information on Shortcuts, see the April 2000 tip.

  8. Click Next and Finish.
    A hidden ActiveX control appears in the topic.

  9. On the topic just created, click TrueCode.

  10. Locate the <BODY> tag.

  11. Add the following parameters:
    <body onLoad=Shortcut.Click();history.back(1)>


    When the topic loads, it activates the hidden shortcut script, which launches notes.txt, and returns you to the same topic without losing your place!
     

  12. Click Save.

Note: DO NOT preview the topic, since you may end up in an endless loop of messages informing you the function only works in a compiled HTML Help window.

Next, Create a custom window button