Skip to main content
srothmanPM
Participant
February 21, 2019
Question

Can I perform a sequence of menu commands as JS?

  • February 21, 2019
  • 3 replies
  • 350 views

If there's a particular sequence of operations in Acrobat DC that I perform using menu options, is there a straightforward way to do the same thing in JavaScript?

In my case, I do this sequence a lot:  "Prepare Form > More > Export Data > Save"

That's only four simple steps - is there way to do it in JS?  Or is there some other route? Thanks. -Steve

This topic has been closed for replies.

3 replies

Thom Parker
Community Expert
Community Expert
February 21, 2019

You are probably better off figuring out the JavaScript functions for running your process, rather than doing it through "menu items". Especially since the one you've listed is not exactly a menu item.

However, to answer your question directly. Here's an article on how to run menu items with JavaScript.

https://acrobatusers.com/tutorials/executing_menu_items_from_javascript

In the early days, everything in Acrobat was a menu item. It's still mostly true, only the menu items are hidden. You'll find a (not free) plug-in here that exposes all the hidden menu items in acrobat.

Search Downloads

And here you'll find an Acrobat JavaScript tool that displays the "Device Independent" menu item names, which you need to run a menu item from JavaScript.

Free Acrobat Automation Tools

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Legend
February 21, 2019

Unfortunately, also, these are not considered menu items. The only menu from which you can automate items is the menu along the top. Otherwise you need to look for specific functions to do what you want, which are rarely there.

try67
Community Expert
Community Expert
February 21, 2019

No, but there's no need to. JavaScript can do it by itself, using the exportAsFDF command.