Skip to main content
Participant
November 23, 2019
質問

Javascript scripting tooling

  • November 23, 2019
  • 返信数 2.
  • 478 ビュー

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/10753722) 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?

このトピックへの返信は締め切られました。

返信数 2

try67
Community Expert
Community Expert
November 23, 2019

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

 

test();

Bernd Alheit
Community Expert
Community Expert
November 23, 2019

You can use folder-level scripts.

Or use a action in the Action Wizard.

Legend
November 23, 2019

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?