Copy link to clipboard
Copied
How do I create a document level javascript in Acrobat X? I'm trying to work with forms in my PDF files.
You need to convert the function into a string and then execute the code I provided with it as the second parameter.
By the way, you should consider upgrading to Acrobat Pro, where applying doc-level scripts is much easier.
Copy link to clipboard
Copied
It can only be done using a script, like this:
this.addScript("ScriptName", "app.alert(\"Hello\"); // script code goes here as a string");
Copy link to clipboard
Copied
Thanks but I’m not sure where to enter that script you suggested. I’m setting up auto tab and have a script to enter in a Document Level JavaScript.
Where do I enter your script?
Mark Bratcher
Consolidated Citrus, LP
3602 Colonial Court
Fort Myers, FL 33913
(239) 275-4060 ext 219
This e-mail is intended for the sole use of the individual(s) to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. You are hereby notified that any dissemination, duplication, or distribution of this email and any files transmitted with it are confidential and intended solely for the individual or entity to which they are addressed. Any unauthorized use, disclosure or distribution of this e-mail and its attachments is prohibited. If you have received this email in error, destroy it immediately.
All emails sent from or to an addressee of King Ranch, Inc. or one of its subsidiaries shall remain the property of King Ranch, Inc.
King Ranch and the Running W logo are both registered trademarks in the United States.
Copy link to clipboard
Copied
Execute it from the JS Console.
Copy link to clipboard
Copied
I guess I’m appearing as a dunce, but where is the JS Console?
I thought I enabled it in the Preferences as in below.
Mark Bratcher
Consolidated Citrus, LP
3602 Colonial Court
Fort Myers, FL 33913
(239) 275-4060 ext 219
This e-mail is intended for the sole use of the individual(s) to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. You are hereby notified that any dissemination, duplication, or distribution of this email and any files transmitted with it are confidential and intended solely for the individual or entity to which they are addressed. Any unauthorized use, disclosure or distribution of this e-mail and its attachments is prohibited. If you have received this email in error, destroy it immediately.
All emails sent from or to an addressee of King Ranch, Inc. or one of its subsidiaries shall remain the property of King Ranch, Inc.
King Ranch and the Running W logo are both registered trademarks in the United States.
Copy link to clipboard
Copied
Press Ctrl+J to open it. Paste the code into it, select it with the mouse
and press Ctrl+Enter to run it.
Copy link to clipboard
Copied
Is there a plug-in I need to install or something? I’ve enabled it in Preferences but nothing happens. I press Ctl+J and still nothing happens.
The Preferences enabling just added it to the Tools list.
Mark Bratcher
Consolidated Citrus, LP
3602 Colonial Court
Fort Myers, FL 33913
(239) 275-4060 ext 219
This e-mail is intended for the sole use of the individual(s) to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. You are hereby notified that any dissemination, duplication, or distribution of this email and any files transmitted with it are confidential and intended solely for the individual or entity to which they are addressed. Any unauthorized use, disclosure or distribution of this e-mail and its attachments is prohibited. If you have received this email in error, destroy it immediately.
All emails sent from or to an addressee of King Ranch, Inc. or one of its subsidiaries shall remain the property of King Ranch, Inc.
King Ranch and the Running W logo are both registered trademarks in the United States.
Copy link to clipboard
Copied
No, it's a part of the application. I don't understand what you mean in the last sentences... What was added to the Tools list?
What happens when you press Ctrl+J?
Copy link to clipboard
Copied
Thanks for your patience. The Preferences Javascript pic is below and the JavaScript “Tool” appeared afterwards. That pic is next. Ctrl + J does nothing.
Mark Bratcher
Consolidated Citrus, LP
3602 Colonial Court
Fort Myers, FL 33913
(239) 275-4060 ext 219
This e-mail is intended for the sole use of the individual(s) to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. You are hereby notified that any dissemination, duplication, or distribution of this email and any files transmitted with it are confidential and intended solely for the individual or entity to which they are addressed. Any unauthorized use, disclosure or distribution of this e-mail and its attachments is prohibited. If you have received this email in error, destroy it immediately.
All emails sent from or to an addressee of King Ranch, Inc. or one of its subsidiaries shall remain the property of King Ranch, Inc.
King Ranch and the Running W logo are both registered trademarks in the United States.
Copy link to clipboard
Copied
To share screenshots you need to post from the forum directly (not via email) and use the Camera icon.
Copy link to clipboard
Copied
Thanks. I'm new to this Adobe forum.
When I enable the Preferences Javascript I see this pic.
The only thing I notice this does is display JavaScript in the Tools list below.
Pressing Ctrl+J like I've seen on other blogs does nothing. I cannot bring up any JS Console. Clicking Set Document Actions only opens this pic and doesn't allow any creations.
Copy link to clipboard
Copied
Thank you for your assistance!
Okay I found out how to launch the JS Console (debugger). Using this syntax to create the javascript,
this.addScript("ScriptName", "app.alert(\"Hello\"); // script code goes here as a string");
how do I insert this Document Level script (lines 1. through 7.) in it? I know how to set up the bottom part.
Copy link to clipboard
Copied
You need to convert the function into a string and then execute the code I provided with it as the second parameter.
By the way, you should consider upgrading to Acrobat Pro, where applying doc-level scripts is much easier.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now