Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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);
}
Copy link to clipboard
Copied
Thanks!
Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
Is this regarding the custom commands? You will have to copy your JavaScript from the folder level script into the custom command, or call the JavaScript function you've defined from within the custom command.
Copy link to clipboard
Copied
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
Find more inspiration, events, and resources on the new Adobe Community
Explore Now