• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Dec 20, 2018 Dec 20, 2018

Copy link to clipboard

Copied

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.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

430

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 20, 2018 Dec 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. 

Votes

Translate

Translate
Community Expert ,
Dec 20, 2018 Dec 20, 2018

Copy link to clipboard

Copied

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 PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 20, 2018 Dec 20, 2018

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 21, 2018 Dec 21, 2018

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 21, 2018 Dec 21, 2018

Copy link to clipboard

Copied

LATEST

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 PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines