How to remove/disable document level JavaScript when running Adobe Action
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Edit (or the Acrobat app menu on a Mac) - Preferences - JavaScript, tick off "Enable Acrobat JavaScript".
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
This is your only option, unless you remove or edit those scripts.
Copy link to clipboard
Copied
You must use this script (before the print action) to remove the document level script:
this.removeScript("Print");
PDF Acrobatic, InDesigner & Photoshoptographer
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
PDF Acrobatic, InDesigner & Photoshoptographer

