PDF In-Depth

Adding JavaScript References to the Acrobat Pro 6 Help Menu

JavaScript Code

Advertisement
 

 

Now that we have the files and have given them a home, let's get started with the fun stuff -- JavaScript code. Get your CTRL keys ready, cut-and-pasters. Here comes the nutshell! (I'm not leaving out Mac-ophiles. Something just tells me they'll keep reading to the end of the article.)

  1. Open a new text file in your favorite editor.
  2. Add code similar to the following:
app.addSubMenu({
        cName: "JSHelp",
        cUser: "JavaScript Help",
        cParent: "Help",
        nPos: 4
});

app.addMenuItem({
        cName: "JSGuide",
        cUser: "JavaScript Guide",
        cParent: "JSHelp",
        nPos: 0,
        cEnable: "event.rc=(!(this.documentFileName=='AcroJSGuide.pdf'));",
        cExec: "app.openDoc(
            '/C/Program Files/Adobe/Acrobat 6.0/Help/ENU/AcroJSGuide.pdf');",
});

app.addMenuItem({
        cName: "JSRef",
        cUser: "JavaScript Reference",
        cParent: "JSHelp",
        nPos: 1,
        cEnable: "event.rc=(!(this.documentFileName=='AcroJS.pdf'));",
        cExec: "app.openDoc(
            '/C/Program Files/Adobe/Acrobat 6.0/Help/ENU/AcroJS.pdf');"
});
  1. Name the file "something.js", or whatever you want. (I used "usrAddJSHelp.js".)
  2. Save the file in the "Javascripts" folder under your Acrobat folder. My path is:

        C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Javascripts\

  1. Close Acrobat. Reopen Acrobat. Check it out.

Updated Help menu

Wave goodbye to the cut-and-paste crowd. Bye!

PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Quick PDF Library

Get products to market faster with this amazing PDF developer SDK. Over 900 functions and an equally...

Download free demo

Back to the past, 15 years ago! Open Publish 2002

Looking back to 2002, it's amazing how much of the prediction became a reality. Take a read and see what you think!

September 14, 2017
Platinum Sponsor





Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.

Features

Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.