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

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

New Here ,
Nov 15, 2022 Nov 15, 2022

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.

TOPICS
General troubleshooting , How to , JavaScript , Print and prepress
4.8K
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 15, 2022 Nov 15, 2022

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

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
New Here ,
Nov 15, 2022 Nov 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.

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 15, 2022 Nov 15, 2022
LATEST

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

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 15, 2022 Nov 15, 2022

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

 

this.removeScript("Print");


PDF Acrobatic, InDesigner & Photoshoptographer
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 15, 2022 Nov 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.

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
New Here ,
Nov 15, 2022 Nov 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.

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 15, 2022 Nov 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.


PDF Acrobatic, InDesigner & Photoshoptographer
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