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

Javascript scripting tooling

New Here ,
Nov 22, 2019 Nov 22, 2019

Copy link to clipboard

Copied

I'm looking to develop a Javascript function relating to this thread https://community.adobe.com/t5/acrobat/acrobat-javascript-extracting-footnotes-technique/m-p/1075372...) and I've spent a while trying to figure out how all the tooling works inside Acrobat.

 

When I click on the Javascript tool I'm presented with a toolbar with options such as Debug | Debugger | Document Javascripts etc. When I click on Document Javascripts I'm able to add one e.g.

 

function test()
{
    return 1+1
}

and the only way I can figure out how to run it is:

 

  1. Close the "Document Javascripts" Window 
  2. Click on "Debugger" on the toolbar
  3. Select the script "test"
  4. Change the view to "Console" below
  5. In the console type in "test()" so that it executes
  6. Hit ctrl+enter

 

This seems like an excessive amount of steps that must be repeated to develop a script. Is there a better way?

 

Further, I can't seem to see anywhere where I can save "global" scripts that I can re-use on multiple PDFs. Is this possible to do?

TOPICS
Acrobat SDK and JavaScript

Views

267

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 ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

You can use folder-level scripts.

Or use a action in the Action Wizard.

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
LEGEND ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

NB restart Acrobat after any change to folder level scripts. 

 

In your flow, why do you close the Javascript debugger? And, for testing, why not just type or paste the whole script?

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 ,
Nov 23, 2019 Nov 23, 2019

Copy link to clipboard

Copied

LATEST

To execute your function you can simply run this command from the Console:

 

test();

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