Skip to main content
Participating Frequently
November 14, 2024
Question

JavaScript to extract button Actions Alerts (JavaScript)

Sometimes I receive interactive PDFs that I need to translate. Some buttons have actions that display alerts in a pop-up window when clicked. It can be time-consuming to check all the buttons to see if any of them have those alerts.

 

I'm looking for a script to export those alerts to a .txt file, and then import it back once the alert text is translated. Is it possible?

PS. I know it is possible to get all code using: Tools > JavaScript > All JavaScript. I just wanted an automated way to export and import it back.

Thank you.

Ce sujet a été fermé aux réponses.

2 commentaires

JR Boulay
Community Expert
Community Expert
November 14, 2024

I know it is possible to get all code using: Tools > JavaScript > All JavaScript. I just wanted an automated way to export and import it back.

Copy-paste the "All JavaScript" text in a text editor.

Use the search feature to find all text strings inside quotes and edit them.

Copy-paste back the new text in "All JavaScript".

Acrobate du PDF, InDesigner et Photoshopographe
Thom Parker
Community Expert
Community Expert
November 14, 2024

Unfortunately a script cannot access other scripts in the PDF.  This type of thing would need to be done with a plug-in. 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often