Skip to main content
Participant
Nov 15, 2022 9:43 AM UTC
Answered

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

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 is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Nov 15, 2022 10:21 AM UTC

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

7 replies

JR Boulay
Community Expert
Community Expert
Nov 15, 2022 10:16 AM UTC

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.

Translate
Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
Community Expert
Nov 15, 2022 9:58 AM UTC

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

 

this.removeScript("Print");

Translate
Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
Nov 15, 2022 10:01 AM UTC

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.

Translate
Participant
Nov 15, 2022 10:09 AM UTC

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.

Translate
try67
Community Expert
Community Expert
Nov 15, 2022 9:55 AM UTC

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

Translate
Participant
Nov 15, 2022 10:08 AM UTC

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.

Translate
try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Nov 15, 2022 10:21 AM UTC

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

Translate