Skip to main content
scripterdan
Participant
December 20, 2018
Answered

Acrobat XI Pro: How do I "Edit all Javascripts"?

  • December 20, 2018
  • 2 replies
  • 706 views

Using Acrobat XI Pro, I can't figure out how to open the window that contains ALL the Javascripts in the document.  I need to add a single line of code to all required fields, and it would be 10x easier if I could go through all the scripts in the document at once, instead of clicking Properties > Actions > Edit for each field.  In Acrobat X Pro, in EDIT mode, I would click Other Tasks > Javascripts > Edit all Javascripts to accomplish the same task, but I'm using Acrobat XI Pro at work, and the menus are very different.

This topic has been closed for replies.
Correct answer Thom Parker

Select "Edit all JavaScripts" on the JavaScript pane on the right side "Tools" panel.  If the JavaScript Pane is not visible, then select it from the dropdown menu on the top right of the Tools panel. 

2 replies

try67
Community Expert
Community Expert
December 21, 2018

You should not edit the code through that window! It can cause serious damage to your file.

I recommend you only use it to locate the code you want to edit and then go to the actual location of that code and edit it there.

Thom Parker
Community Expert
Community Expert
December 21, 2018

Or, here a couple strategies for handling multiple code changes that reduce both time/effort to maintain code and the human error associated with making the same change over and over again.

1.  If the code is short segments used in a field script, then use "field.setAction" the Console to set the script everywhere it is needed. You aught to be able to do this in a single loop, cause  in such cases(where the same script is needed in many fields) your field names should follow a regular pattern.

2. If the code is long, but only slightly different in every place it is used, then create a document level function to encapsulate the code, replacing the differences with variables. Then call this function from all the places where it is needed using strategy #1.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
December 20, 2018

Select "Edit all JavaScripts" on the JavaScript pane on the right side "Tools" panel.  If the JavaScript Pane is not visible, then select it from the dropdown menu on the top right of the Tools panel. 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
scripterdan
Participant
December 20, 2018

Thank you, Thom.  That's been bugging the crap out of me.