Skip to main content
Participant
November 15, 2022
Answered

How to remove/disable document level JavaScript when running Adobe Action

  • November 15, 2022
  • 3 replies
  • 7953 views

I have a simple action to print all PDF's in a folder (was the best way to do it whilst keeping them in order and not wanting to merge), however, some of te PDF's have a document level JavaScript (named "Print") that pops up the "This document is trying to print..." dialog box. Is there a way to disable that from happening, tried searching for JavaScript to disable them but couldn't find anything? Any help appreciated.

This topic has been closed for replies.
Correct answer try67

This is your only option, unless you remove or edit those scripts.

3 replies

JR Boulay
Community Expert
Community Expert
November 15, 2022

So you have to use a first action to remove the script in all these PDFs, and then use a second action to print them.

Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
Community Expert
November 15, 2022

You must use this script (before the print action) to remove the document level script:

 

this.removeScript("Print");

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
November 15, 2022

I don't think they want to remove that code entirely (if I understood correctly), just not have it execute during the Action. Anyway, even if you run an Action with that command, the code will execute before it is removed by the Action.

Participant
November 15, 2022

I did try this one from my prior searching, but as you said, it didn't work. I am not fussed if the doc level Java is deleted or disabled, as the PDF's will be saved for printing only and then deleted.

try67
Community Expert
Community Expert
November 15, 2022

Edit (or the Acrobat app menu on a Mac) - Preferences - JavaScript, tick off "Enable Acrobat JavaScript".

Participant
November 15, 2022

Thankyou, I am using that currently but have other Actions that use JavaScript so would prefer to not have to remember to turn it off/on for different tasks.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
November 15, 2022

This is your only option, unless you remove or edit those scripts.