Skip to main content
Participant
February 22, 2016
Question

Once I've created your JavaScript, how do I get it assigned to a button that I can add to the toolbar without buying a toolset? Thanks!

  • February 22, 2016
  • 2 replies
  • 971 views

I have created a javascript to automate some functions for various users and need to add a button to the toolbar to launch it.  How do I do this without having to purchase a toolkit?

Thanks so much for any help.

This topic has been closed for replies.

2 replies

Karl Heinz  Kremer
Community Expert
Community Expert
February 22, 2016

If you have Adobe Acrobat DC Pro, you can also create custom commands to execute your JavaScript: Create Custom Commands in Adobe Acrobat DC Pro - KHKonsulting LLC

try67
Community Expert
Community Expert
February 22, 2016

Read about the addToolButton and addMenuItem methods of the app object.

You can use the former like this, basically:

app.addToolButton({

    cName: "myToolButton", // internal name, must be unique

    cLabel: "My Function", // the text of the button the user sees

    cExec: "myFunction();", // the code to execute when the button is clicked

    cTooltext: "Click here to run my function", // the tooltip text for the button

    cEnable: true // when the button is enabled/disabled

});

And then your actual code is placed inside of myFunction:

function myFunction() {

    app.alert("Hello!",3);

}

Participant
February 22, 2016

Thanks!

Participant
February 22, 2016

Great!  How do I add it to the toolbar.  I went to Customize, but cannot find the JS in AddOns or in Javascript.  I did save it to the user JS folder.

Thanks!