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

JavaScript to extract button Actions Alerts (JavaScript)

Community Beginner ,
Nov 13, 2024 Nov 13, 2024

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.

TOPICS
JavaScript , PDF , PDF forms
191
Translate
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 13, 2024 Nov 13, 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 PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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 14, 2024 Nov 14, 2024
LATEST

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
Translate
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